✨ (user) create validation in user update data
This commit is contained in:
@ -2,6 +2,10 @@ import { saveFile } from "..";
|
||||
import { AppError } from "../../../error/instances/app";
|
||||
|
||||
export const saveAvatar = async (file: File): Promise<string> => {
|
||||
if (Array.isArray(file)) {
|
||||
throw new AppError(415, "Can't upload more than 1 file");
|
||||
}
|
||||
|
||||
const allowedTypes = ["image/png", "image/jpeg", "image/webp"];
|
||||
if (!allowedTypes.includes(file.type)) {
|
||||
throw new AppError(
|
||||
|
||||
Reference in New Issue
Block a user