mirror of
https://github.com/zadam/trilium.git
synced 2026-01-06 14:44:25 +01:00
Merge remote-tracking branch 'origin/develop' into renovate/better-sqlite3-7.x
This commit is contained in:
commit
758768e4d5
@ -26,9 +26,9 @@
|
|||||||
"start-test-server": "npm run switch-server; rimraf ./data-test; cross-env TRILIUM_DATA_DIR=./data-test TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev TRILIUM_PORT=9999 ts-node src/main.ts",
|
"start-test-server": "npm run switch-server; rimraf ./data-test; cross-env TRILIUM_DATA_DIR=./data-test TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev TRILIUM_PORT=9999 ts-node src/main.ts",
|
||||||
"qstart-server": "npm run switch-server && npm run start-server",
|
"qstart-server": "npm run switch-server && npm run start-server",
|
||||||
"start-electron": "npm run prepare-dist && cross-env TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron ./dist/electron-main.js --inspect=5858 .",
|
"start-electron": "npm run prepare-dist && cross-env TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron ./dist/electron-main.js --inspect=5858 .",
|
||||||
"start-electron-nix": "npm run prepare-dist && cross-env TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev nix-shell -p electron_31 --run \"electron ./dist/electron-main.js --inspect=5858 .\"",
|
"start-electron-nix": "npm run prepare-dist && cross-env TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev nix-shell -p electron_33 --run \"electron ./dist/electron-main.js --inspect=5858 .\"",
|
||||||
"start-electron-no-dir": "npm run prepare-dist && cross-env TRILIUM_ENV=dev electron --inspect=5858 .",
|
"start-electron-no-dir": "npm run prepare-dist && cross-env TRILIUM_ENV=dev electron --inspect=5858 .",
|
||||||
"start-electron-no-dir-nix": "npm run prepare-dist && cross-env TRILIUM_ENV=dev nix-shell -p electron_31 --run \"electron ./dist/electron-main.js --inspect=5858 .\"",
|
"start-electron-no-dir-nix": "npm run prepare-dist && cross-env TRILIUM_ENV=dev nix-shell -p electron_33 --run \"electron ./dist/electron-main.js --inspect=5858 .\"",
|
||||||
"qstart-electron": "npm run switch-electron && npm run start-electron",
|
"qstart-electron": "npm run switch-electron && npm run start-electron",
|
||||||
"switch-server": "rimraf ./node_modules/better-sqlite3 && npm install",
|
"switch-server": "rimraf ./node_modules/better-sqlite3 && npm install",
|
||||||
"switch-electron": "npx electron-rebuild",
|
"switch-electron": "npx electron-rebuild",
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import sanitize_attribute_name from "../../services/sanitize_attribute_name.js";
|
|||||||
import specialNotesService from "../../services/special_notes.js";
|
import specialNotesService from "../../services/special_notes.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
|
|
||||||
function uploadImage(req: Request) {
|
async function uploadImage(req: Request) {
|
||||||
const file = req.file;
|
const file = req.file;
|
||||||
|
|
||||||
if (!file) {
|
if (!file) {
|
||||||
@ -24,7 +24,7 @@ function uploadImage(req: Request) {
|
|||||||
return [400, "Invalid image content type."];
|
return [400, "Invalid image content type."];
|
||||||
}
|
}
|
||||||
|
|
||||||
const uploadedImageType = imageType(file.buffer);
|
const uploadedImageType = await imageType(file.buffer);
|
||||||
if (!uploadedImageType) {
|
if (!uploadedImageType) {
|
||||||
return [400, "Unable to determine image type."];
|
return [400, "Unable to determine image type."];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user