-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Both the type and the openAPI documentation were inaccurate to the shape of the data returned by the database when loading a `User`. The actual data being returned is what we wanted, so we just need to fix the definitions and docs.
- Loading branch information
Showing
5 changed files
with
159 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
import { ajv } from '../ajv'; | ||
import type { JSONSchemaType } from 'ajv'; | ||
|
||
enum Permission { | ||
MANAGE = 'manage', | ||
EDIT = 'edit', | ||
VIEW = 'view', | ||
} | ||
|
||
export { Permission }; | ||
const permissionSchema: JSONSchemaType<Permission> = { | ||
type: 'string', | ||
enum: Object.values(Permission), | ||
}; | ||
|
||
const isPermission = ajv.compile(permissionSchema); | ||
|
||
export { Permission, permissionSchema, isPermission }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters