chore: I hate formatting shit

pull/243/head
Josh Moore 1 year ago
parent 351195d7b5
commit adac5a1538

@ -108,12 +108,12 @@ export const put = (sector: DataSector, key: NID, data: AssFile | AssUser): Prom
const useSql = MySql.ready;
if (sector === 'files') {
data = data as AssFile;
// * 1: Save as files (image, video, etc)
// ? Local JSON
data = data as AssFile;
if (!useSql) {
// ? Local JSON
const filesJson = await fs.readJson(PATHS.files) as FilesSchema;
// Check if key already exists
@ -129,14 +129,17 @@ export const put = (sector: DataSector, key: NID, data: AssFile | AssUser): Prom
// Save the files
await bothWriter(filesJson, usersJson);
} else {
// ? SQL
}
} else {
data = data as AssUser;
// * 2: Save as users
// ? Local JSON
data = data as AssUser;
if (!useSql) {
// ? Local JSON
const usersJson = await fs.readJson(PATHS.users) as UsersSchema;
// Check if key already exists
@ -146,6 +149,9 @@ export const put = (sector: DataSector, key: NID, data: AssFile | AssUser): Prom
usersJson.users[key] = data;
await fs.writeJson(PATHS.users, usersJson, { spaces: '\t' });
} else {
// ? SQL
}
}

Loading…
Cancel
Save