fix: missing field input

This commit is contained in:
Methapon Metanipat 2024-09-06 13:38:18 +07:00
parent ad26a551f0
commit f911384242

View file

@ -85,6 +85,8 @@ type UserCreate = {
districtId?: string | null;
provinceId?: string | null;
selectedImage?: string;
branchId: string | string[];
};
@ -126,6 +128,8 @@ type UserUpdate = {
email?: string;
telephoneNo?: string;
selectedImage?: string;
subDistrictId?: string | null;
districtId?: string | null;
provinceId?: string | null;
@ -284,17 +288,7 @@ export class UserController extends Controller {
]);
return {
result: await Promise.all(
result.map(async (v) => ({
...v,
branch: includeBranch ? v.branch.map((a) => a.branch) : undefined,
profileImageUrl: await presignedGetObjectIfExist(
MINIO_BUCKET,
imageLocation(v.id),
12 * 60 * 60,
),
})),
),
result,
page,
pageSize,
total,
@ -841,7 +835,7 @@ export class UserProfileController extends Controller {
}
@Delete("{name}")
async deleteAttachment(@Path() userId: string, @Path() name: string) {
async deleteImage(@Path() userId: string, @Path() name: string) {
await minio.removeObject(MINIO_BUCKET, fileLocation.user.profile(userId, name), {
forceDelete: true,
});