Skip to content

Commit

Permalink
add public url into prefix (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
siren authored Aug 26, 2022
1 parent e2227b6 commit 4d298d3
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions admin-ui/src/common/urls.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { publicUrl } from "./const";

export const prefixes = {
recurringReservations: "/recurring-reservations",
reservations: "/reservations",
Expand All @@ -8,19 +10,19 @@ export const prefixes = {
export const applicationRoundUrl = (
applicationRoundId: number | string
): string =>
`${prefixes.recurringReservations}/application-rounds/${applicationRoundId}`;
`${publicUrl}${prefixes.recurringReservations}/application-rounds/${applicationRoundId}`;

export const applicationUrl = (applicationId: number | string): string =>
`${prefixes.applications}/${applicationId}`;
`${publicUrl}${prefixes.applications}/${applicationId}`;

export const reservationUrl = (reservationId: number | string): string =>
`${prefixes.reservations}/${reservationId}`;
`${publicUrl}${prefixes.reservations}/${reservationId}`;

export const requestedReservationsUrl = (): string =>
`${prefixes.reservations}/requested`;
`${publicUrl}${prefixes.reservations}/requested`;

export const applicationDetailsUrl = (applicationId: number | string): string =>
`${prefixes.applications}/${applicationId}/details`;
`${publicUrl}${prefixes.applications}/${applicationId}/details`;

export const applicationRoundApplications = (
applicationRoundId: number | string | null
Expand All @@ -29,6 +31,8 @@ export const applicationRoundApplications = (
export const reservationUnitUrl = (
reservationUnitId: number,
unitId: number
): string => `/unit/${unitId}/reservationUnit/edit/${reservationUnitId}`;
): string =>
`${publicUrl}/unit/${unitId}/reservationUnit/edit/${reservationUnitId}`;

export const unitUrl = (unitId: number): string => `/unit/${unitId}`;
export const unitUrl = (unitId: number): string =>
`${publicUrl}/unit/${unitId}`;

0 comments on commit 4d298d3

Please sign in to comment.