Skip to content

Commit

Permalink
♻️ [#574] Refactor endpoints in frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm authored and svenvandescheur committed Jan 2, 2025
1 parent 00abf52 commit de7f505
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions frontend/.storybook/mockData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,19 @@ export const MOCKS = {
response: usersFactory(),
},
RECORD_MANAGERS: {
url: "http://localhost:8000/api/v1/record-managers/",
url: "http://localhost:8000/api/v1/users?role=record_manager",
method: "GET",
status: 200,
response: [recordManagerFactory()],
},
REVIEWERS: {
url: "http://localhost:8000/api/v1/reviewers/",
url: "http://localhost:8000/api/v1/users?role=main_reviewer",
method: "GET",
status: 200,
response: usersFactory(),
},
CO_REVIEWERS: {
url: "http://localhost:8000/api/v1/co-reviewers/",
url: "http://localhost:8000/api/v1/users?role=co_reviewer",
method: "GET",
status: 200,
response: usersFactory(),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/api/archivist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type Archivist = {
* List all the users that have the permission to archive destruction lists.
*/
export async function listArchivists() {
const response = await request("GET", "/archivists/");
const response = await request("GET", "/users", { role: "archivist" });
const promise: Promise<User[]> = response.json();
return promise;
}
2 changes: 1 addition & 1 deletion frontend/src/lib/api/recordManagers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { request } from "./request";
*/
export async function listRecordManagers() {
return cacheMemo("listRecordManagers", async () => {
const response = await request("GET", "/record-managers/");
const response = await request("GET", "/users", { role: "record_manager" });
const promise: Promise<User[]> = response.json();
return promise;
});
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/api/reviewers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { request } from "./request";
*/
export async function listReviewers() {
return cacheMemo("listReviewers", async () => {
const response = await request("GET", "/reviewers/");
const response = await request("GET", "/users", { role: "main_reviewer" });
const promise: Promise<User[]> = response.json();
return promise;
});
Expand All @@ -18,7 +18,7 @@ export async function listReviewers() {
*/
export async function listCoReviewers() {
return cacheMemo("listCoReviewers", async () => {
const response = await request("GET", "/co-reviewers/");
const response = await request("GET", "/users", { role: "co_reviewer" });
const promise: Promise<User[]> = response.json();
return promise;
});
Expand Down

0 comments on commit de7f505

Please sign in to comment.