You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mvfront-react/services/routes.ts

25 lines
724 B

/**
* This file provides the paths to the pages
*/
import {getWindowUrl} from './utils';
export const CREATE_ELECTION = '/admin/new/';
export const getUrlVote = (electionId: string | number, token?: string): URL => {
const origin = getWindowUrl();
if (token)
return new URL(`/vote/${electionId}/${token}`, origin);
return new URL(`/vote/${electionId}`, origin);
}
export const getUrlResults = (electionId: string | number): URL => {
const origin = getWindowUrl();
return new URL(`/result/${electionId}`, origin);
}
export const getUrlAdmin = (electionId: string | number, adminToken: string): URL => {
const origin = getWindowUrl();
return new URL(`/admin/${electionId}?t=${adminToken}`, origin);
}