mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-27 18:24:43 +10:00
Fix torrential depot (#353)
Adds a plugin to automatically add/update the torrential depot record
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
import { systemConfig } from "../internal/config/sys-conf";
|
||||||
|
import prisma from "../internal/db/database";
|
||||||
|
|
||||||
|
export default defineNitroPlugin(async () => {
|
||||||
|
const torrentialUrl = `${systemConfig.getExternalUrl()}/api/v1/depot/`;
|
||||||
|
|
||||||
|
await prisma.depot.upsert({
|
||||||
|
where: {
|
||||||
|
id: "torrential",
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
endpoint: torrentialUrl,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
id: "torrential",
|
||||||
|
endpoint: torrentialUrl,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user