feat(ui): use query to populate infill methods dropdown

- available infill methods is server state - remove it from client state, use the query to populate the dropdown
- add listener to ensure the selected infill method is an available one
This commit is contained in:
psychedelicious
2023-07-13 15:22:25 +10:00
parent 4d25d702a1
commit 978016ea51
5 changed files with 41 additions and 44 deletions

View File

@ -1,5 +1,5 @@
import { api } from '..';
import { AppVersion, AppConfig } from '../types';
import { AppConfig, AppVersion } from '../types';
export const appInfoApi = api.injectEndpoints({
endpoints: (build) => ({
@ -8,12 +8,14 @@ export const appInfoApi = api.injectEndpoints({
url: `app/version`,
method: 'GET',
}),
keepUnusedDataFor: 86400000, // 1 day
}),
getAppConfig: build.query<AppConfig, void>({
query: () => ({
url: `app/config`,
method: 'GET',
}),
keepUnusedDataFor: 86400000, // 1 day
}),
}),
});