-
Notifications
You must be signed in to change notification settings - Fork 7
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
47a7df3
commit 80bcf37
Showing
8 changed files
with
130 additions
and
99 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
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 |
---|---|---|
|
@@ -77,5 +77,6 @@ export namespace BackendApi { | |
export interface Meta { | ||
response?: { | ||
headers: Headers | ||
status: number | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,8 +1,22 @@ | ||
import { searchVesselsFromAPI } from '../../../api/vessel' | ||
import { RTK_FORCE_REFETCH_QUERY_OPTIONS } from '@api/constants' | ||
import { Vessel } from '@features/Vessel/Vessel.types' | ||
import { vesselApi } from '@features/Vessel/vesselApi' | ||
|
||
import { setError } from '../../shared_slices/Global' | ||
|
||
import type { MainAppThunk } from '@store' | ||
|
||
/** @deprecated Use Redux RTK `searchVessels()` query. */ | ||
export const searchVessels = searched => dispatch => | ||
searchVesselsFromAPI(searched).catch(error => { | ||
dispatch(setError(error)) | ||
}) | ||
export const searchVessels = | ||
(searched: string): MainAppThunk<Promise<Vessel.VesselIdentity[] | undefined>> => | ||
async dispatch => { | ||
try { | ||
return await dispatch( | ||
vesselApi.endpoints.searchVessels.initiate({ searched }, RTK_FORCE_REFETCH_QUERY_OPTIONS) | ||
).unwrap() | ||
} catch (error) { | ||
dispatch(setError(error)) | ||
|
||
return undefined | ||
} | ||
} |
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