refactor(SW-188): replace anon or auth procedure with serviceProcedure
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user