mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 08:10:28 +09:00
프론트엔드에서의 파일 업로드 전 중복 검사 구현
This commit is contained in:
1 parent
59c8523e25
commit
5c7dc58f03
8 files changed
+161
-12
No files matched your search
@@ -220,6 +220,23 @@ export const getAllFilesByParent = async (userId: number, parentId: DirectoryId)
|
||||
);
|
||||
};
|
||||
|
||||
export const getAllFileIdsByContentHmac = async (
|
||||
userId: number,
|
||||
hskVersion: number,
|
||||
contentHmac: string,
|
||||
) => {
|
||||
return await db
|
||||
.select({ id: file.id })
|
||||
.from(file)
|
||||
.where(
|
||||
and(
|
||||
eq(file.userId, userId),
|
||||
eq(file.hskVersion, hskVersion),
|
||||
eq(file.contentHmac, contentHmac),
|
||||
),
|
||||
);
|
||||
};
|
||||
|
||||
export const getFile = async (userId: number, fileId: number) => {
|
||||
const res = await db
|
||||
.select()
|
||||
|
||||
Reference in new issue
Block a user