feat(customer-image): add head endpoint
This commit is contained in:
parent
21e5467f55
commit
09dbac1aa2
1 changed files with 21 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import {
|
|||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
Head,
|
||||
Path,
|
||||
Post,
|
||||
Put,
|
||||
|
|
@ -24,7 +25,15 @@ import {
|
|||
createPermCondition,
|
||||
} from "../services/permission";
|
||||
import { filterStatus } from "../services/prisma";
|
||||
import { deleteFile, deleteFolder, fileLocation, getFile, listFile, setFile } from "../utils/minio";
|
||||
import {
|
||||
deleteFile,
|
||||
deleteFolder,
|
||||
fileLocation,
|
||||
getFile,
|
||||
getPresigned,
|
||||
listFile,
|
||||
setFile,
|
||||
} from "../utils/minio";
|
||||
import { isUsedError, notFoundError, relationError } from "../utils/error";
|
||||
import { connectOrNot } from "../utils/relation";
|
||||
|
||||
|
|
@ -488,6 +497,17 @@ export class CustomerImageController extends Controller {
|
|||
);
|
||||
}
|
||||
|
||||
@Head("{name}")
|
||||
async headImage(
|
||||
@Request() req: RequestWithUser,
|
||||
@Path() customerId: string,
|
||||
@Path() name: string,
|
||||
) {
|
||||
return req.res?.redirect(
|
||||
await getPresigned("head", fileLocation.customer.img(customerId, name), 12 * 60 * 60),
|
||||
);
|
||||
}
|
||||
|
||||
@Put("{name}")
|
||||
@Security("keycloak")
|
||||
async putImage(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue