feat: doc template (#10)

* feat: doc-template

* fix: empty not converted to dash

* feat: also return province, district and sub district

* refactor: move some relation to outer

* feat: add more function

* chore: deps

* feat: add more relation

* feat: count employee by gender

* feat: count all employee

* feat: add more function

* feat: get employment office

* fix: error

---------

Co-authored-by: Methapon2001 <61303214+Methapon2001@users.noreply.github.com>
This commit is contained in:
Methapon Metanipat 2025-01-22 11:27:47 +07:00 committed by GitHub
parent 67651eb213
commit 4e3c51d84b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 456 additions and 13 deletions

View file

@ -1,3 +1,4 @@
import { buffer } from "node:stream/consumers";
import minio from "../services/minio";
if (!process.env.MINIO_BUCKET) {
@ -26,6 +27,10 @@ export async function getFile(path: string, exp = 60 * 60) {
return await minio.presignedGetObject(MINIO_BUCKET, path, exp);
}
export async function getFileBuffer(path: string) {
return await minio.getObject(MINIO_BUCKET, path).then(buffer);
}
export async function setFile(path: string, exp = 6 * 60 * 60) {
return await minio.presignedPutObject(MINIO_BUCKET, path, exp);
}