mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 08:06:56 +00:00
컴파일 오류 등 수정
This commit is contained in:
@@ -8,8 +8,9 @@ import {
|
||||
setDirectoryEncName,
|
||||
unregisterDirectory,
|
||||
getAllFilesByParent,
|
||||
type NewDirectoryParams,
|
||||
type NewDirectory,
|
||||
} from "$lib/server/db/file";
|
||||
import type { Ciphertext } from "$lib/server/db/schema";
|
||||
|
||||
export const getDirectoryInformation = async (userId: number, directoryId: "root" | number) => {
|
||||
const directory = directoryId !== "root" ? await getDirectory(userId, directoryId) : undefined;
|
||||
@@ -53,11 +54,10 @@ export const renameDirectory = async (
|
||||
userId: number,
|
||||
directoryId: number,
|
||||
dekVersion: Date,
|
||||
newEncName: string,
|
||||
newEncNameIv: string,
|
||||
newEncName: Ciphertext,
|
||||
) => {
|
||||
try {
|
||||
await setDirectoryEncName(userId, directoryId, dekVersion, newEncName, newEncNameIv);
|
||||
await setDirectoryEncName(userId, directoryId, dekVersion, newEncName);
|
||||
} catch (e) {
|
||||
if (e instanceof IntegrityError) {
|
||||
if (e.message === "Directory not found") {
|
||||
@@ -70,7 +70,7 @@ export const renameDirectory = async (
|
||||
}
|
||||
};
|
||||
|
||||
export const createDirectory = async (params: NewDirectoryParams) => {
|
||||
export const createDirectory = async (params: NewDirectory) => {
|
||||
const oneMinuteAgo = new Date(Date.now() - 60 * 1000);
|
||||
const oneMinuteLater = new Date(Date.now() + 60 * 1000);
|
||||
if (params.dekVersion <= oneMinuteAgo || params.dekVersion >= oneMinuteLater) {
|
||||
|
||||
Reference in New Issue
Block a user