Skip to content

Commit

Permalink
Only show Student users in GuidanceRecords
Browse files Browse the repository at this point in the history
  • Loading branch information
chrsrns committed Nov 21, 2023
1 parent 3a8e3fd commit 26e6837
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion routes/guidancerecords.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ router.get("/records-by/:id", isAuthenticated, async (req, res, next) => {
}
});

router.get("/users", async (req, res, next) => {
router.get("/students", async (req, res, next) => {
try {
const users = await prisma.user.findMany({
where: {
type: user_type.Student,
approved: { not: user_approval_type.Archived }
},
select: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const GuidanceRecordsForm = () => {

const fetchAll = () => {
setIsLoading(true)
customFetch(`${global.server_backend_url}/backend/guidancerecords/users`)
customFetch(`${global.server_backend_url}/backend/guidancerecords/students`)
.then((response) => {
if (response.ok) return response.json();
else throw response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const SelectedGuidanceRecords = () => {

const fetchAll = () => {
setIsLoading(true)
customFetch(`${global.server_backend_url}/backend/guidancerecords/users`)
customFetch(`${global.server_backend_url}/backend/guidancerecords/students`)
.then((response) => {
if (response.ok) return response.json();
else throw response;
Expand Down

0 comments on commit 26e6837

Please sign in to comment.