mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-21 22:34:21 +00:00
🐛 Fix users request paths
This commit is contained in:
parent
0416367b8d
commit
6cd63b3122
3 changed files with 3 additions and 3 deletions
|
@ -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,
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue