a-n-u-p-01 / Journal-Rest-API

Open to contribute, improve your debug skill by contributing this project. Thank you!
6 stars 1 forks source link

User Deletion with Admin Role #1

Closed a-n-u-p-01 closed 2 months ago

a-n-u-p-01 commented 2 months ago

Currently, the application does not allow the deletion of users with the "ADMIN" role. Implement a feature to transfer the admin role to another user before deletion.

StrawHatLuffy2303 commented 2 months ago

can you tell me more about it

a-n-u-p-01 commented 2 months ago

can you tell me more about it

How to create admin?

StrawHatLuffy2303 commented 2 months ago

okk give me sometime i wil solve this

StrawHatLuffy2303 commented 2 months ago

and also i dont know about monodb so i will use mysql ...so its okk for you

a-n-u-p-01 commented 2 months ago

and also i dont know about monodb so i will use mysql ...so its okk for you

This application uses MongoDB with Spring Data, which works very much like using JPA with MySQL. The way you write code to interact with the database is almost the same, so you don’t need to learn a completely new system. Spring Boot handles most of the complex parts, making MongoDB just as easy to use as MySQL. Please use MongoDB for this project.

StrawHatLuffy2303 commented 2 months ago

okk bro i have done this project in my sql . give me sometime i will learn little bit about mongo db then i will inform you the task you have given i have created endpoint for your issuse if you want code i can provide you

StrawHatLuffy2303 commented 2 months ago
  1. When an admin user tries to delete themselves, the system checks if they are the only admin user in the database.
  2. If they are the only admin user, the system prevents them from deleting themselves and prompts them to transfer their admin role to another user.
  3. Once the admin role is transferred, the original admin user can be deleted, ensuring that there is always at least one admin user remaining in the database.

I have added all condition on my endpoint is it what you want or diffrent.

a-n-u-p-01 commented 2 months ago

okk bro i have done this project in my sql . give me sometime i will learn little bit about mongo db then i will inform you the task you have given i have created endpoint for your issuse if you want code i can provide you

Thanks for your work on this. Please debug the application and fix any issues you find. After fixing them, create a pull request (PR) with your changes. Working with different codebases and databases will help you learn and grow your skills. Let me know if you need help with MongoDB or anything else.

StrawHatLuffy2303 commented 2 months ago

you are making journal REST Api am i correct and i want to know the project is completed or in running

a-n-u-p-01 commented 2 months ago

you are making journal REST Api am i correct and i want to know the project is completed or in running

Yes it is completed and working. Here is the postman collection, import it Journal App postman_collection

StrawHatLuffy2303 commented 2 months ago

thanks bro i will work on it and tell you.

but bro you have issue i think with deletion so i can share you code bro because i will fork and implement and modify in my way and it will take time beacuse i am using java 21 and mysql.

i am saying if you want that part of code just take it from me i am gonna make repo for your Admin Deletion Process: just open my profile and copy that code and change in your way what you want

StrawHatLuffy2303 commented 2 months ago

when i learn mongodb and some spring security because i only know little bit about them.😅 i am also fresher and started learning. and also i am using vs code ,java 21, latest springboot,mysql latest and thunderclient for apis.that my config for all projects i have one unti now

a-n-u-p-01 commented 2 months ago

when i learn mongodb and some spring security because i only know little bit about them.😅 i am also fresher and started learning.

I’ve made this repo public so Spring Boot learners can debug it and offer different perspectives. There’s no need to rush—please take your time to solve the issues on your own. Debugging other codebases is a great way to learn and see different approaches. Thanks!

StrawHatLuffy2303 commented 2 months ago

Thanks bro i will debug and modify it.And after all done i will request.

StrawHatLuffy2303 commented 2 months ago

bro you can also check my repo and if there is any modification or changes you will do i really appreciate.i have also rest api please check it if there is any issue

a-n-u-p-01 commented 2 months ago

bro you can also check my repo and if there is any modification or changes you will do i really appreciate.i have also rest api please check it if there is any issue

please share which one , I’m currently busy with my job, but I’ll review it when I have some free time.

StrawHatLuffy2303 commented 2 months ago

OO SORRY ,i didn't you are busy.Its OK bro. https://github.com/StrawHatLuffy2303/Insurance-Management-System