Skip to content

Commit

Permalink
Merge pull request #270 from mnfst/269-admin-panel-cannot-manage-admins
Browse files Browse the repository at this point in the history
🐛 fix(entityManifest): admin props not displayed in manifest
  • Loading branch information
brunobuddy authored Jan 22, 2025
2 parents f32492d + 01aed5b commit 83e5a58
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/lucky-bikes-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'manifest': patch
---

fixed admins cannot be managed in admin panel
32 changes: 16 additions & 16 deletions packages/core/manifest/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ export const DEFAULT_IMAGE_SIZES: ImageSizesObject = {
}
}

export const AUTHENTICABLE_PROPS: PropertyManifest[] = [
{
name: 'email',
type: PropType.Email,
hidden: true,
validation: { isNotEmpty: true }
},
{
name: 'password',
type: PropType.Password,
hidden: true,
validation: { isNotEmpty: true }
}
]

// Admin entity.
export const DEFAULT_ADMIN_CREDENTIALS = {
email: '[email protected]',
Expand All @@ -41,7 +56,7 @@ export const ADMIN_ENTITY_MANIFEST: EntityManifest = {
authenticable: true,
nameSingular: 'admin',
namePlural: 'admins',
properties: [],
properties: AUTHENTICABLE_PROPS,
relationships: [],
belongsToMany: [],
policies: {
Expand All @@ -53,21 +68,6 @@ export const ADMIN_ENTITY_MANIFEST: EntityManifest = {
}
}

export const AUTHENTICABLE_PROPS: PropertyManifest[] = [
{
name: 'email',
type: PropType.Email,
hidden: true,
validation: { isNotEmpty: true }
},
{
name: 'password',
type: PropType.Password,
hidden: true,
validation: { isNotEmpty: true }
}
]

// Reserved words that are not considered as filters.
export const QUERY_PARAMS_RESERVED_WORDS = [
'page',
Expand Down

0 comments on commit 83e5a58

Please sign in to comment.