mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-12-23 22:58:17 -05:00
Prevent unnecessary redirect when requesting users
Opening the share dialog, the frontend is requesting `/auth/users/` which is always redirected to `/auth/users`. That's an unnecessary extra step. This patch makes the front-end request `/auth/users` in the first place.
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
if (modal) {
|
||||
modal.showModal();
|
||||
}
|
||||
let res = await fetch(`/auth/users/`);
|
||||
let res = await fetch(`/auth/users`);
|
||||
if (res.ok) {
|
||||
let data = await res.json();
|
||||
allUsers = data;
|
||||
|
||||
@@ -9,7 +9,7 @@ export const load = (async (event) => {
|
||||
return redirect(302, '/login');
|
||||
}
|
||||
|
||||
const res = await fetch(`${serverEndpoint}/auth/users/`, {
|
||||
const res = await fetch(`${serverEndpoint}/auth/users`, {
|
||||
headers: {
|
||||
Cookie: `sessionid=${sessionId}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user