1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 14:54:22 +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) setError(undefined)
try { try {
const loginRequest = await axios.post<SophonToken>("/api/auth/token/", {username, password}) 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({ authorization.dispatch({
type: "success:login", type: "success:login",
user: dataRequest.data, user: dataRequest.data,

View file

@ -34,7 +34,7 @@ export function useCacheContext(): Cache | undefined {
* @constructor * @constructor
*/ */
export function CacheProvider({children}: WithChildren): JSX.Element { 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 = const usersIdMap =
React.useMemo( 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 { export interface SophonUser extends DjangoResource {
id: number, id: number,