mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
컴파일 오류 등 수정
This commit is contained in:
@@ -20,6 +20,6 @@ export const POST: RequestHandler = async ({ locals, params, request }) => {
|
||||
if (!bodyZodRes.success) error(400, "Invalid request body");
|
||||
const { dekVersion, name, nameIv } = bodyZodRes.data;
|
||||
|
||||
await renameDirectory(userId, id, new Date(dekVersion), name, nameIv);
|
||||
await renameDirectory(userId, id, new Date(dekVersion), { ciphertext: name, iv: nameIv });
|
||||
return text("Directory renamed", { headers: { "Content-Type": "text/plain" } });
|
||||
};
|
||||
|
||||
@@ -17,8 +17,7 @@ export const POST: RequestHandler = async ({ locals, request }) => {
|
||||
mekVersion,
|
||||
encDek: dek,
|
||||
dekVersion: new Date(dekVersion),
|
||||
encName: name,
|
||||
encNameIv: nameIv,
|
||||
encName: { ciphertext: name, iv: nameIv },
|
||||
});
|
||||
return text("Directory created", { headers: { "Content-Type": "text/plain" } });
|
||||
};
|
||||
|
||||
@@ -20,6 +20,6 @@ export const POST: RequestHandler = async ({ locals, params, request }) => {
|
||||
if (!bodyZodRes.success) error(400, "Invalid request body");
|
||||
const { dekVersion, name, nameIv } = bodyZodRes.data;
|
||||
|
||||
await renameFile(userId, id, new Date(dekVersion), name, nameIv);
|
||||
await renameFile(userId, id, new Date(dekVersion), { ciphertext: name, iv: nameIv });
|
||||
return text("File renamed", { headers: { "Content-Type": "text/plain" } });
|
||||
};
|
||||
|
||||
@@ -40,12 +40,9 @@ const parseFileMetadata = (userId: number, json: string) => {
|
||||
contentHmac,
|
||||
contentType,
|
||||
encContentIv: contentIv,
|
||||
encName: name,
|
||||
encNameIv: nameIv,
|
||||
encCreatedAt: createdAt ?? null,
|
||||
encCreatedAtIv: createdAtIv ?? null,
|
||||
encLastModifiedAt: lastModifiedAt,
|
||||
encLastModifiedAtIv: lastModifiedAtIv,
|
||||
encName: { ciphertext: name, iv: nameIv },
|
||||
encCreatedAt: createdAt && createdAtIv ? { ciphertext: createdAt, iv: createdAtIv } : null,
|
||||
encLastModifiedAt: { ciphertext: lastModifiedAt, iv: lastModifiedAtIv },
|
||||
} satisfies FileMetadata;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user