From 214d6b821c2d1a01286ddb9b33a8afcc750bb9ba Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 5 Oct 2021 19:34:13 +0200 Subject: :art: move field error to util --- api/src/util/FieldError.ts | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 api/src/util/FieldError.ts (limited to 'api/src/util/FieldError.ts') diff --git a/api/src/util/FieldError.ts b/api/src/util/FieldError.ts deleted file mode 100644 index 0b3f93d2..00000000 --- a/api/src/util/FieldError.ts +++ /dev/null @@ -1,25 +0,0 @@ -import "missing-native-js-functions"; - -export function FieldErrors(fields: Record) { - return new FieldError( - 50035, - "Invalid Form Body", - fields.map(({ message, code }) => ({ - _errors: [ - { - message, - code: code || "BASE_TYPE_INVALID" - } - ] - })) - ); -} - -// TODO: implement Image data type: Data URI scheme that supports JPG, GIF, and PNG formats. An example Data URI format is: data:image/jpeg;base64,BASE64_ENCODED_JPEG_IMAGE_DATA -// Ensure you use the proper content type (image/jpeg, image/png, image/gif) that matches the image data being provided. - -export class FieldError extends Error { - constructor(public code: string | number, public message: string, public errors?: any) { - super(message); - } -} -- cgit 1.5.1