refactor(SW-188): replace anon or auth procedure with serviceProcedure

This commit is contained in:
Chuma McPhoy
2024-08-13 15:59:07 +02:00
parent a1a0a73e3a
commit ed379202c8
7 changed files with 55 additions and 80 deletions

View File

@@ -1,22 +0,0 @@
import { Lang } from "@/constants/languages"
const langMap: { [key in Lang]: string } = {
[Lang.en]: "En",
[Lang.sv]: "Sv",
[Lang.no]: "No",
[Lang.fi]: "Fi",
[Lang.da]: "Da",
[Lang.de]: "De",
}
/**
* Helper function to convert Lang enum to uppercase
* Needed for the Hotel endpoint.
*/
export const toApiLang = (lang: Lang): string => {
const result = langMap[lang]
if (!result) {
throw new Error("Invalid language")
}
return result
}