Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: added AdminJS as the admin panel #34

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

hugo2006alm
Copy link
Contributor

The admin Panel was added and configured for editing Users and Tickets.
Also, the User model has a new field "isAdmin", used to check if the User has access to the Admin panel.

image

image

@hugo2006alm hugo2006alm changed the title feat: added AdminJS as the admin panel feature: added AdminJS as the admin panel Jan 10, 2025
Copy link
Member

@limwa limwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add instructions on what needs to be done after add a new model or modifying an existing one

@limwa
Copy link
Member

limwa commented Jan 19, 2025

This PR doesn't build as-is. I'm getting the following error:

2025-Jan-19 19:49:56.868911
#18 58.79 app/admin/auth.ts(38,3): error TS2322: Type '({ email, password }: DefaultAuthenticatePayload) => Promise<{ email: string; id: number; } | null>' is not assignable to type '(payload: DefaultAuthenticatePayload, context?: any) => Promise<CurrentAdmin | null>'.
2025-Jan-19 19:49:56.868911
#18 58.79   Type 'Promise<{ email: string; id: number; } | null>' is not assignable to type 'Promise<CurrentAdmin | null>'.
2025-Jan-19 19:49:56.868911
#18 58.79     Type '{ email: string; id: number; } | null' is not assignable to type 'CurrentAdmin | null'.
2025-Jan-19 19:49:56.868911
#18 58.79       Type '{ email: string; id: number; }' is not assignable to type 'CurrentAdmin'.
2025-Jan-19 19:49:56.868911
#18 58.79         Types of property 'id' are incompatible.
2025-Jan-19 19:49:56.868911
#18 58.79           Type 'number' is not assignable to type 'string'.

@tomaspalma
Copy link
Member

For reference, I've added a seeder that creates a mock admin account.

email: [email protected]
password: password

@tomaspalma tomaspalma changed the base branch from main to develop February 11, 2025 10:27
@limwa limwa linked an issue Feb 18, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Admin Interface
3 participants