Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
huytran17 committed Jun 4, 2024
1 parent 56c63da commit 3ee1a2a
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function makeUploadAdminAvatarController({
throw new Error(`Admin by ${_id} does not exist`);
}

const file = <IFileInfo>get(httpRequest, "context.file", {});
const file = <IFileMeta>get(httpRequest, "context.file", {});

if (isEmpty(file)) {
throw new Error(`File does not exist`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function makeUploadCategoryThumbnailController({
throw new Error(`Categiry by ${_id} does not exist`);
}

const file = <IFileInfo>get(httpRequest, "context.file", {});
const file = <IFileMeta>get(httpRequest, "context.file", {});

if (isEmpty(file)) {
throw new Error(`File does not exist`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function makeUploadGalleryItemController({
const { _id } = <IGetGalleryPayload>(
get(httpRequest, "context.validated", {})
);
const file = <IFileInfo>get(httpRequest, "context.file", {});
const file = <IFileMeta>get(httpRequest, "context.file", {});

if (isEmpty(file)) {
throw new Error(`File does not exist`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function makeUploadPostThumbnailController({
throw new Error(`Post by ${_id} does not exist`);
}

const file = <IFileInfo>get(httpRequest, "context.file", {});
const file = <IFileMeta>get(httpRequest, "context.file", {});

if (isEmpty(file)) {
throw new Error(`File does not exist`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function makeUploadFolderIconController({
throw new Error(`System configuration by ${exists._id} does not exist`);
}

const file = <IFileInfo>get(httpRequest, "context.file", {});
const file = <IFileMeta>get(httpRequest, "context.file", {});

if (isEmpty(file)) {
throw new Error(`File does not exist`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function makeUploadOwnerAvatarController({
throw new Error(`System configuration by ${exists._id} does not exist`);
}

const file = <IFileInfo>get(httpRequest, "context.file", {});
const file = <IFileMeta>get(httpRequest, "context.file", {});

if (isEmpty(file)) {
throw new Error(`File does not exist`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function makeUploadThumbnaiilController({
throw new Error(`System configuration by ${exists._id} does not exist`);
}

const file = <IFileInfo>get(httpRequest, "context.file", {});
const file = <IFileMeta>get(httpRequest, "context.file", {});

if (isEmpty(file)) {
throw new Error(`File does not exist`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function makeUploadUserAvatarController({
throw new Error(`User by ${_id} does not exist`);
}

const file = <IFileInfo>get(httpRequest, "context.file", {});
const file = <IFileMeta>get(httpRequest, "context.file", {});

if (isEmpty(file)) {
throw new Error(`File does not exist`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function makeUploadUserAvatarController({
throw new Error(`User by ${_id} does not exist`);
}

const file = <IFileInfo>get(httpRequest, "context.file", {});
const file = <IFileMeta>get(httpRequest, "context.file", {});

if (isEmpty(file)) {
throw new Error(`File does not exist`);
Expand Down
2 changes: 1 addition & 1 deletion core/server/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export {};

declare global {
interface IFileInfo {
interface IFileMeta {
filename: string;
originalname: string;
encoding: string;
Expand Down

0 comments on commit 3ee1a2a

Please sign in to comment.