-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ccf2b92
commit b86f766
Showing
18 changed files
with
153 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react' | ||
import { monitorenvPrivateApi } from './api' | ||
|
||
import type { ControlTheme } from '../domain/entities/controlThemes' | ||
|
||
export const controlThemesAPI = createApi({ | ||
baseQuery: fetchBaseQuery({ baseUrl: '/bff/v1' }), | ||
export const controlThemesAPI = monitorenvPrivateApi.injectEndpoints({ | ||
endpoints: build => ({ | ||
getControlTheme: build.query<ControlTheme, { id: number }>({ | ||
query: ({ id }) => `controlthemes/${id}` | ||
query: ({ id }) => `/v1/controlthemes/${id}` | ||
}), | ||
getControlThemes: build.query<ControlTheme[], void>({ | ||
query: () => `controlthemes` | ||
}) | ||
}), | ||
reducerPath: 'controlThemes' | ||
}) | ||
}) | ||
|
||
export const { useGetControlThemesQuery } = controlThemesAPI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react' | ||
import { monitorenvPrivateApi } from './api' | ||
|
||
import type { NatinfType } from '../domain/entities/natinfs' | ||
|
||
export const infractionsAPI = createApi({ | ||
baseQuery: fetchBaseQuery({ baseUrl: '/bff/v1' }), | ||
export const infractionsAPI = monitorenvPrivateApi.injectEndpoints({ | ||
endpoints: build => ({ | ||
getInfractions: build.query<NatinfType[], void>({ | ||
query: () => `natinfs` | ||
query: () => `/v1/natinfs` | ||
}) | ||
}), | ||
reducerPath: 'natinfs' | ||
}) | ||
}) | ||
|
||
export const { useGetInfractionsQuery } = infractionsAPI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
import { type EntityState, createEntityAdapter } from '@reduxjs/toolkit' | ||
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react' | ||
|
||
import { monitorenvPrivateApi } from './api' | ||
|
||
import type { Semaphore } from '../domain/entities/semaphore' | ||
|
||
const SemaphoreAdapter = createEntityAdapter<Semaphore>() | ||
const initialState = SemaphoreAdapter.getInitialState() | ||
|
||
export const semaphoresAPI = createApi({ | ||
baseQuery: fetchBaseQuery({ baseUrl: '/bff/v1' }), | ||
export const semaphoresAPI = monitorenvPrivateApi.injectEndpoints({ | ||
endpoints: build => ({ | ||
getSemaphores: build.query<EntityState<Semaphore>, void>({ | ||
query: () => 'semaphores', | ||
query: () => '/v1/semaphores', | ||
transformResponse: (response: Semaphore[]) => SemaphoreAdapter.setAll(initialState, response) | ||
}) | ||
}), | ||
reducerPath: 'semaphores' | ||
}) | ||
}) | ||
|
||
export const { useGetSemaphoresQuery } = semaphoresAPI |
Oops, something went wrong.