Skip to content

Commit f97fc25

Browse files
authored
Fix torrential depot (#353)
Adds a plugin to automatically add/update the torrential depot record
1 parent dbe3468 commit f97fc25

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { systemConfig } from "../internal/config/sys-conf";
2+
import prisma from "../internal/db/database";
3+
4+
export default defineNitroPlugin(async () => {
5+
const torrentialUrl = `${systemConfig.getExternalUrl()}/api/v1/depot/`;
6+
7+
await prisma.depot.upsert({
8+
where: {
9+
id: "torrential",
10+
},
11+
update: {
12+
endpoint: torrentialUrl,
13+
},
14+
create: {
15+
id: "torrential",
16+
endpoint: torrentialUrl,
17+
},
18+
});
19+
});

0 commit comments

Comments
 (0)