fix the thousand year old bug
This commit is contained in:
parent
9809bd3793
commit
ce4e014acb
4 changed files with 52 additions and 48 deletions
7
prisma/migrations/20240501012209_fix/migration.sql
Normal file
7
prisma/migrations/20240501012209_fix/migration.sql
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
-- DropIndex
|
||||||
|
DROP INDEX `Upload_fileName_key` ON `Upload`;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `UserSettings` MODIFY `embedColor` INTEGER NOT NULL DEFAULT 0,
|
||||||
|
MODIFY `embedDescription` VARCHAR(191) NOT NULL DEFAULT 'Uploaded by {{username}} at {{time}}',
|
||||||
|
MODIFY `embedTitle` VARCHAR(191) NOT NULL DEFAULT '{{file}}';
|
|
@ -40,9 +40,9 @@ model UserSettings {
|
||||||
newPostsPublic Boolean @default(false)
|
newPostsPublic Boolean @default(false)
|
||||||
linkToRaw Boolean @default(false)
|
linkToRaw Boolean @default(false)
|
||||||
|
|
||||||
embedTitle String
|
embedTitle String @default("{{file}}")
|
||||||
embedDescription String
|
embedDescription String @default("Uploaded by {{username}} at {{time}}")
|
||||||
embedColor Int
|
embedColor Int @default(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
model Upload {
|
model Upload {
|
||||||
|
@ -50,7 +50,7 @@ model Upload {
|
||||||
uploader User @relation(fields: [uploaderId], references: [id])
|
uploader User @relation(fields: [uploaderId], references: [id])
|
||||||
uploaderId Int
|
uploaderId Int
|
||||||
|
|
||||||
fileName String @unique
|
fileName String
|
||||||
public Boolean @default(false)
|
public Boolean @default(false)
|
||||||
uploaded DateTime @default(now())
|
uploaded DateTime @default(now())
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
/** @type {import("@sveltejs/kit").Load } */
|
|
||||||
export function load({ fetch }) {
|
|
||||||
const statistics = fetch('/api/statistics').then((response) => response.json());
|
|
||||||
|
|
||||||
return {
|
|
||||||
streamed: {
|
|
||||||
statistics
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,4 +1,11 @@
|
||||||
/** @type {import("@sveltejs/kit").Load} */
|
/** @type {import("@sveltejs/kit").ServerLoad} */
|
||||||
export function load({ locals }) {
|
export function load({ locals, fetch }) {
|
||||||
return { user: locals?.user };
|
const statistics = fetch('/api/statistics').then((response) => response.json());
|
||||||
|
|
||||||
|
return {
|
||||||
|
user: locals?.user,
|
||||||
|
streamed: {
|
||||||
|
statistics
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue