-
Notifications
You must be signed in to change notification settings - Fork 2
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
7abbfb0
commit 1008623
Showing
5 changed files
with
9 additions
and
68 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
19 changes: 3 additions & 16 deletions
19
apps/dolly-frontend/src/main/js/src/components/transaksjonid/GyldigeBestillinger.tsx
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,19 +1,6 @@ | ||
import { useAsync } from 'react-use' | ||
import { DollyApi } from '@/service/Api' | ||
|
||
type Bestilling = { | ||
data: Array<BestillingData> | ||
} | ||
|
||
type BestillingData = { | ||
status: string | ||
} | ||
import { useTransaksjonsid } from '@/utils/hooks/useTransaksjonsid' | ||
|
||
export const erGyldig = (bestillingId: number, system: string, ident: string) => { | ||
const finnBestilling = useAsync(async () => { | ||
const response: Bestilling = await DollyApi.getTransaksjonid(system, ident, bestillingId) | ||
return response.data | ||
}, []) | ||
|
||
return finnBestilling.value && finnBestilling.value.length > 0 | ||
const { transaksjonsid, loading } = useTransaksjonsid(system, ident, bestillingId) | ||
return !loading && transaksjonsid && transaksjonsid.length > 0 | ||
} |
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