mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
10 lines
299 B
TypeScript
10 lines
299 B
TypeScript
import Translation from "App/Models/Translation";
|
|
|
|
export default async function getTranslation(code: string): Promise<Translation> {
|
|
let translation = await Translation.findBy('code', code)
|
|
if (!translation) {
|
|
translation = await Translation.create({code: code})
|
|
}
|
|
return translation
|
|
}
|