Skip to content

Commit

Permalink
Merge pull request #25336 from mshima/current-sessions
Browse files Browse the repository at this point in the history
fix sessions api
  • Loading branch information
DanielFran committed Feb 27, 2024
2 parents ab43706 + 2ae039a commit 2a4eaaf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ export class SessionsService {
private http = inject(HttpClient);
private applicationConfigService = inject(ApplicationConfigService);

private resourceUrl = this.applicationConfigService.getEndpointFor('api/account/sessions/');
private resourceUrl = this.applicationConfigService.getEndpointFor('api/account/sessions');

findAll(): Observable<Session[]> {
return this.http.get<Session[]>(this.resourceUrl);
}

delete(series: string): Observable<{}> {
return this.http.delete(`${this.resourceUrl}${series}`);
return this.http.delete(`${this.resourceUrl}/${series}`);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ const initialState = {
export type SessionsState = Readonly<typeof initialState>;

// Actions
const apiUrl = '/api/account/sessions/';
const apiUrl = '/api/account/sessions';

export const findAll = createAsyncThunk('sessions/find_all', async () => axios.get<any>(apiUrl), {
serializeError: serializeAxiosError,
});

export const invalidateSession = createAsyncThunk('sessions/invalidate', async (series: any) => axios.delete(`${apiUrl}${series}`), {
export const invalidateSession = createAsyncThunk('sessions/invalidate', async (series: any) => axios.delete(`${apiUrl}/${series}`), {
serializeError: serializeAxiosError,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default defineComponent({
},
methods: {
retrieveSessions() {
return axios.get('api/account/sessions/').then(response => {
return axios.get('api/account/sessions').then(response => {
this.error = null;
this.sessions = response.data;
});
Expand Down

0 comments on commit 2a4eaaf

Please sign in to comment.