-
Notifications
You must be signed in to change notification settings - Fork 5
made warden side partially working #29
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
base: main
Are you sure you want to change the base?
Conversation
23abdul23
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If confused, ask me about more implemntation details
| {/* <Stack.Screen name="Emergency" component={EmergencyScreen} /> */} | ||
| {/* <Stack.Screen name="Profile" component={ProfileScreen} /> */} | ||
| <Stack.Screen name="Scan" component={Scanner} /> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are here these comments when they are not being used.
| required: true, | ||
| unique: true, | ||
| sparse: true, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Device id doesn't make sense we can remove this from every model schema. Because it is possible that someone has logged in to some new device.
Remove all occurances and use of 'deviceID'
| createdAt: { | ||
| fontSize: SIZES.xs, | ||
| color: COLORS.gray[500], | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the need of making new OUTPASS component , when there was already OutpaasCard.js the component was already their , u need to simply reuse that and modify it a little bit.
what you can do is add a simple code block
if (role == 'student')
...simple outpass card
if (role =='warden')
....add two buttons of Approve and Reject
(Chat GPT / Copilot jo bhi de sb mat use karo)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those changes were complex to integrate and warden ka role related to outpass alag h its better uska alag card rhe and maine edit krke hi code use kiya h gpt se :|
| console.log("INCOMING REGISTRATION DATA:", req.body); | ||
| const { name, email, password, studentId, guardId, wardenId, hostel, roomNumber, phoneNumber, securityPost, emergencyContact, gender, year, department, role} = req.body | ||
| const { name, email, password, studentId, guardId, wardenId, hostel, roomNumber, phoneNumber, securityPost, gender, year, department, role, deviceId} = req.body | ||
| let user; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove deviceID
| } | ||
| }) | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check when the outpass are being created , they are still getting auto approved. Change that to pending.
Also there is many not useful routes commented , delete all that is not so useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok :|
| /> | ||
| </View> | ||
| ) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same outpassScreen.js can be used here also , just update the things as required using (role == 'warden')
Only make new files if introducing minor changes is too difficullt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but warden role is different its better uska sb kuch alag rhe in my opinion
| const { user, logout } = useAuth() | ||
|
|
||
| const isStudent = user.role === "student" | ||
| const isWarden = user.role === "warden" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this variable is not used anywhere??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its used below. its usage is to separate components to be displayed in a students profile section and in a warden's profile section. like for a student we want to display the "Academic Info" but we dont want this for warden ...so basically vo neeche ek jagah use horha
| createOutpass: (data) => api.post("/outpass/generate", data), | ||
| updateOutpass: (id, data) => api.put(`/outpass/${id}`, data), | ||
| getHistory: (params) => api.get("/outpass/history", { params }), | ||
| getPendingRequests: () => api.get("/outpass/warden/requests"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do the required changes for the fetchProfile and other api routes , refactor them accordingly.
No description provided.