This commit is contained in:
syuilo 2025-08-11 12:09:25 +09:00
parent 1d8e183883
commit 299f9e3115
1 changed files with 6 additions and 4 deletions

View File

@ -317,7 +317,7 @@ export const uploadFile = async (user?: UserToken, { path, name, blob }: UploadO
const formData = new FormData();
formData.append('file', blob ??
new File([await readFile(absPath)], basename(absPath.toString())));
new File([new Uint8Array(await readFile(absPath))], basename(absPath.toString())));
formData.append('force', 'true');
if (name) {
formData.append('name', name);
@ -608,8 +608,8 @@ export async function initTestDb(justBorrow = false, initEntities?: any[]) {
username: config.db.user,
password: config.db.pass,
database: config.db.db,
synchronize: true && !justBorrow,
dropSchema: true && !justBorrow,
synchronize: !justBorrow,
dropSchema: !justBorrow,
entities: initEntities ?? entities,
});
@ -661,7 +661,9 @@ export async function captureWebhook<T = SystemWebhookPayload>(postAction: () =>
let timeoutHandle: NodeJS.Timeout | null = null;
const result = await new Promise<string>(async (resolve, reject) => {
fastify.all('/', async (req, res) => {
timeoutHandle && clearTimeout(timeoutHandle);
if (timeoutHandle) {
clearTimeout(timeoutHandle);
}
const body = JSON.stringify(req.body);
res.status(200).send('ok');