1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-10-16 07:07:26 +00:00

🐛 Fix users request paths

This commit is contained in:
Steffo 2021-11-01 17:23:04 +01:00
parent 0416367b8d
commit 6cd63b3122
3 changed files with 3 additions and 3 deletions

View file

@ -44,7 +44,7 @@ export function AuthorizationLoginButton({username, password, disabled = false}:
setError(undefined)
try {
const loginRequest = await axios.post<SophonToken>("/api/auth/token/", {username, password})
const dataRequest = await axios.get<SophonUser>(`/api/core/users-by-username/${username}/`)
const dataRequest = await axios.get<SophonUser>(`/api/core/users/by-username/${username}/`)
authorization.dispatch({
type: "success:login",
user: dataRequest.data,

View file

@ -34,7 +34,7 @@ export function useCacheContext(): Cache | undefined {
* @constructor
*/
export function CacheProvider({children}: WithChildren): JSX.Element {
const users = useManagedViewSet<SophonUser>("/api/core/users-by-id/", "id")
const users = useManagedViewSet<SophonUser>("/api/core/users/by-id/", "id")
const usersIdMap =
React.useMemo(

View file

@ -10,7 +10,7 @@ export interface SophonToken extends DjangoResource {
/**
* A Django User, as returned by the `/api/core/users-by-id/` and `/api/core/users-by-username/` endpoints.
* A Django User, as returned by the `/api/core/users-by-id/` and `/api/core/users/by-username/` endpoints.
*/
export interface SophonUser extends DjangoResource {
id: number,