Skip to content

Commit

Permalink
implement slots last available date api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicarrojado committed Feb 22, 2024
1 parent 1b2c6aa commit 7a19c43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/api-hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ export function useGetLastAvailableSlotsDate() {

const axios = (await import('axios')).default;
const res = await axios.get(
`${API_URL}${ApiEndpoint.LAST_AVAILABLE_SLOTS_INFO}`
`${API_URL}${ApiEndpoint.SLOTS_LAST_AVAILABLE_DATES}`
);

if (!res.data || !res.data.updatedAt) {
if (!res.data || !res.data.tourism) {
throw new Error('No data');
}

const date = new Date(res.data.updatedAt);
const date = new Date(res.data.tourism);
const formattedDate = new Intl.DateTimeFormat('en-GB', {
year: 'numeric',
month: 'long',
Expand Down
2 changes: 1 addition & 1 deletion lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export enum ApiEndpoint {
SUBSCRIPTION_REQUESTS = '/subscription-requests',
SUBSCRIPTION_REQUEST_VERIFY = '/subscription-requests/:id/verify',
SUBSCRIPTION = '/subscriptions/contact-mode/:contact-mode/topics/:topic',
LAST_AVAILABLE_SLOTS_INFO = '/japan-visa-checker/last-available-slots-info',
SLOTS_LAST_AVAILABLE_DATES = '/japan-visa-checker/slots-last-available-dates',
}

export enum FetchState {
Expand Down

0 comments on commit 7a19c43

Please sign in to comment.