mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 02:13:48 +00:00
62c8319d70
refactor: extract functions to api domain refactor: strict custom field parsing refactor: remove rundown cache utilities refactor: directory restructure
18 lines
466 B
TypeScript
18 lines
466 B
TypeScript
import { Request } from 'express';
|
|
import multer, { FileFilterCallback } from 'multer';
|
|
|
|
import { storage } from '../../utils/upload.js';
|
|
|
|
const filterClientSecret = (_req: Request, file: Express.Multer.File, cb: FileFilterCallback) => {
|
|
if (file.mimetype.includes('application/json')) {
|
|
cb(null, true);
|
|
} else {
|
|
cb(null, false);
|
|
}
|
|
};
|
|
|
|
export const uploadClientSecret = multer({
|
|
storage,
|
|
fileFilter: filterClientSecret,
|
|
}).single('client_secret');
|