Restructure the process of changing a password

+ Requests are now dispatched to the according user ressource, not the collection
+ The current user can be referenced by setting the pid to 'current'
+ Refactored the error logic
This commit is contained in:
Stephan
2022-04-28 12:49:07 +02:00
committed by Stefan-5422
parent ff9d5b7912
commit f3c165bbd7
3 changed files with 88 additions and 57 deletions
+20
View File
@@ -0,0 +1,20 @@
export enum DataType {
STRING = "string",
NUMBER = "number",
INTEGER = "integer",
PERMISSION_LEVEL = "'ELEVATED' | 'STANDARD'",
}
interface Body {
[k: string]: DataType;
}
export function generateInvalidBodyError(body: Body) {
return {
type: "error",
payload: {
message: "The body of your request did not conform to the requirements",
schema: { body },
},
};
}