fix tsc errors

This commit is contained in:
Mary Hipp
2024-06-26 14:38:29 -04:00
committed by psychedelicious
parent a7ea096b28
commit 8fce168dc5
2 changed files with 7 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import { getStore } from 'app/store/nanostores/store';
import { selectListBoardsQueryArgs } from 'features/gallery/store/gallerySelectors';
import { boardsApi } from 'services/api/endpoints/boards';
import { imagesApi } from 'services/api/endpoints/images';
import { modelsApi } from 'services/api/endpoints/models';
@@ -43,9 +44,10 @@ export const checkImageAccess = async (name: string): Promise<boolean> => {
* @returns A promise that resolves to true if the client has access, else false.
*/
export const checkBoardAccess = async (id: string): Promise<boolean> => {
const { dispatch } = getStore();
const { dispatch, getState } = getStore();
try {
const req = dispatch(boardsApi.endpoints.listAllBoards.initiate());
const queryArgs = selectListBoardsQueryArgs(getState());
const req = dispatch(boardsApi.endpoints.listAllBoards.initiate(queryArgs));
req.unsubscribe();
const result = await req.unwrap();
return result.some((b) => b.board_id === id);