Fixed: Admin
Fixed #142 also, Fixed #176 Added feat to add and edit Problems and Tracks in admin
Final Changes
https://github.com/code100x/daily-code/assets/136337515/98628979-38de-462d-bec2-ccc042a891a2
Added feat to link Track and Problems
https://github.com/code100x/daily-code/assets/136337515/909b0819-cb9a-424c-80aa-770af1985d1d
good start its missing
- image in the track
- A way to attach problems to tracks
LMK if u'd like to work on it. If not we can merge this as is and someone else can pick it up
What does LinkProblems do?
Added feat to link Track and Problems 2. A way to attach problems to tracks What does
LinkProblemsdo? link.mp4
it lets users add existing Problems to a track by using ProblemID. I have attached a video of it
- image in the track
it shows the image link for now do you want it to image and image link when click on edit
LMK if u'd like to work on it. If not we can merge this as is and someone else can pick it up
I would like to work on it and #176
hey @hkirat , I have Added auth to Admin and
good start its missing
- image in the track
Changed the image link text to 'Image'. Now, I will work on #176. You can merge it, or I can commit to this PR only, whichever you prefer.
https://github.com/code100x/daily-code/assets/136337515/f0bafb0f-ca54-4da4-9849-8fa0d0f1889b
Have added login for the issue #176?
@hkirat Added #176
https://github.com/code100x/daily-code/assets/136337515/1787577a-703b-480b-8ed4-281a7a2e1b04
reviewing
Didnt review it too much will be merging and winging it If there are follow ups will create and more issues and tag you @ShubhamMewara /bounty $125
Can't we add a role in the authOptions callback,
Verify the role from .env file
Similar to how it's done in cms
And in /app/admin, add a layout.tsx file which will check the if the role is admin, otherwise redirect to "/"
Add the admin's email id in the env file and you're good to go, no need to keep modifying the db
@hkirat @ShubhamMewara
@nimit9 can you tell why that is a better option?
Will have to manually add the admin boolean to the db.
ok, I will do it if @hkirat asked thank you.
Didnt review it too much will be merging and winging it If there are follow ups will create and more issues and tag you @ShubhamMewara /bounty $125
Ok , Thank you
Determining admin role can be done anyhow, but adding the check in layout.tsx makes more sense.
This way, there will be a central check done for admin.
Anyone can add the feature in /admin without worrying about how to protect it.
Ah that probably makes sense why it was done re: local development Personally I like it better for it to be in the DB For this repo this is fine
Also I'm going through the change and it is very comprehensive. Amazing job @ShubhamMewara
@hkirat Thank you so much!
Yes, good job @ShubhamMewara.
Yes, good job @ShubhamMewara.
Thank you.