mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 08:06:56 +00:00
사소한 리팩토링
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { TRPCError } from "@trpc/server";
|
||||
import { z } from "zod";
|
||||
import { CategoryIdSchema } from "$lib/schemas";
|
||||
import { CategoryRepo, FileRepo, IntegrityError } from "$lib/server/db";
|
||||
import { categoryIdSchema } from "$lib/server/schemas";
|
||||
import { router, roleProcedure } from "../init.server";
|
||||
|
||||
const categoryRouter = router({
|
||||
get: roleProcedure["activeClient"]
|
||||
.input(
|
||||
z.object({
|
||||
id: categoryIdSchema,
|
||||
id: CategoryIdSchema,
|
||||
recurse: z.boolean().default(false),
|
||||
}),
|
||||
)
|
||||
@@ -65,7 +65,7 @@ const categoryRouter = router({
|
||||
create: roleProcedure["activeClient"]
|
||||
.input(
|
||||
z.object({
|
||||
parent: categoryIdSchema,
|
||||
parent: CategoryIdSchema,
|
||||
mekVersion: z.int().positive(),
|
||||
dek: z.base64().nonempty(),
|
||||
dekVersion: z.date(),
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { TRPCError } from "@trpc/server";
|
||||
import { z } from "zod";
|
||||
import { DirectoryIdSchema } from "$lib/schemas";
|
||||
import { FileRepo, IntegrityError } from "$lib/server/db";
|
||||
import { safeUnlink } from "$lib/server/modules/filesystem";
|
||||
import { directoryIdSchema } from "$lib/server/schemas";
|
||||
import { router, roleProcedure } from "../init.server";
|
||||
|
||||
const directoryRouter = router({
|
||||
get: roleProcedure["activeClient"]
|
||||
.input(
|
||||
z.object({
|
||||
id: directoryIdSchema,
|
||||
id: DirectoryIdSchema,
|
||||
}),
|
||||
)
|
||||
.query(async ({ ctx, input }) => {
|
||||
@@ -59,7 +59,7 @@ const directoryRouter = router({
|
||||
create: roleProcedure["activeClient"]
|
||||
.input(
|
||||
z.object({
|
||||
parent: directoryIdSchema,
|
||||
parent: DirectoryIdSchema,
|
||||
mekVersion: z.int().positive(),
|
||||
dek: z.base64().nonempty(),
|
||||
dekVersion: z.date(),
|
||||
|
||||
@@ -6,11 +6,11 @@ import mime from "mime";
|
||||
import { dirname } from "path";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { z } from "zod";
|
||||
import { DirectoryIdSchema } from "$lib/schemas";
|
||||
import { FileRepo, MediaRepo, UploadRepo, IntegrityError } from "$lib/server/db";
|
||||
import db from "$lib/server/db/kysely";
|
||||
import env from "$lib/server/loadenv";
|
||||
import { getChunkDirectoryPath, safeUnlink } from "$lib/server/modules/filesystem";
|
||||
import { directoryIdSchema } from "$lib/server/schemas";
|
||||
import { router, roleProcedure } from "../init.server";
|
||||
|
||||
const uploadLocks = new Set<string>();
|
||||
@@ -20,7 +20,7 @@ const uploadRouter = router({
|
||||
.input(
|
||||
z.object({
|
||||
chunks: z.int().positive(),
|
||||
parent: directoryIdSchema,
|
||||
parent: DirectoryIdSchema,
|
||||
mekVersion: z.int().positive(),
|
||||
dek: z.base64().nonempty(),
|
||||
dekVersion: z.date(),
|
||||
|
||||
Reference in New Issue
Block a user