Skip to content

Commit 3146ee4

Browse files
authored
Merge pull request #6 from Eternal-Encoders/release
Change Api Path
2 parents 55e0228 + d27747a commit 3146ee4

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

src/components/map/path-map/PathMapHook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function usePathMap() {
1515
from: points.from.id,
1616
to: points.to.id
1717
});
18-
path = data;
18+
path = data?.res;
1919
}
2020

2121

src/features/api/apiSlice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';
2-
import { IGraphPoint, IInstitute, IMapObject, IPath, PointTypes } from '../../utils/interfaces';
2+
import { IGraphPoint, IInstitute, IMapObject, IPathRes, PointTypes } from '../../utils/interfaces';
33

44
const urlOrigin = import.meta.env.VITE_HOST
55
?
@@ -89,7 +89,7 @@ export const apiSlice = createApi({
8989
method: 'GET',
9090
})
9191
}),
92-
getPath: build.query<IPath, IPathReq>({
92+
getPath: build.query<IPathRes, IPathReq>({
9393
query: ({ from, to }) => ({
9494
url: '/path',
9595
params: {

src/utils/interfaces.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,14 @@ export interface IInstitute {
164164
}
165165
}
166166

167+
export interface IPathRes {
168+
res: {
169+
[institute: string]: {
170+
[floor: number]: IGraphPoint[][]
171+
}
172+
}
173+
}
174+
167175
export interface IPath {
168176
[institute: string]: {
169177
[floor: number]: IGraphPoint[][]

0 commit comments

Comments
 (0)