Remove "_id" fields from /api/lang endpoint
This commit is contained in:
parent
a12b82f470
commit
91cafb2bf3
|
@ -3,11 +3,11 @@ import { Lang } from "./mongodb";
|
||||||
export const getLang = async (language = "en") => {
|
export const getLang = async (language = "en") => {
|
||||||
const lang = await Lang(language);
|
const lang = await Lang(language);
|
||||||
return {
|
return {
|
||||||
general: await lang[0].find({}).toArray(),
|
general: (await lang[0].find({}).toArray()).map(({ _id, ...rest }) => rest),
|
||||||
buildings: await lang[1].find({}).toArray(),
|
buildings: (await lang[1].find({}).toArray()).map(({ _id, ...rest }) => rest),
|
||||||
ships: await lang[2].find({}).toArray(),
|
ships: (await lang[2].find({}).toArray()).map(({ _id, ...rest }) => rest),
|
||||||
resources: await lang[3].find({}).toArray(),
|
resources: (await lang[3].find({}).toArray()).map(({ _id, ...rest }) => rest),
|
||||||
research: await lang[4].find({}).toArray(),
|
research: (await lang[4].find({}).toArray()).map(({ _id, ...rest }) => rest),
|
||||||
structures: await lang[5].find({}).toArray()
|
structures: (await lang[5].find({}).toArray()).map(({ _id, ...rest }) => rest)
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue