fix: wrong structure return
This commit is contained in:
parent
624f4f2fd7
commit
17135be8cf
1 changed files with 4 additions and 13 deletions
|
|
@ -197,19 +197,10 @@ export class BranchController extends Controller {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "Branch cannot be found.", "data_not_found");
|
throw new HttpError(HttpStatus.NOT_FOUND, "Branch cannot be found.", "data_not_found");
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return Object.assign(record, {
|
||||||
...record,
|
imageUrl: await minio.presignedGetObject(MINIO_BUCKET, branchImageLoc(record.id)),
|
||||||
contact: record.contact
|
qrCodeImageUrl: await minio.presignedGetObject(MINIO_BUCKET, lineImageLoc(record.id)),
|
||||||
? await Promise.all(
|
});
|
||||||
record.contact.map(async (v) =>
|
|
||||||
Object.assign(v, {
|
|
||||||
imageUrl: await minio.presignedGetObject(MINIO_BUCKET, branchImageLoc(v.id)),
|
|
||||||
qrCodeImageUrl: await minio.presignedGetObject(MINIO_BUCKET, lineImageLoc(v.id)),
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: undefined,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post()
|
@Post()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue