This commit is contained in:
Andras Bacsai
2022-10-26 10:27:33 +02:00
parent c34de3d0a3
commit eb0aa20fe1
5 changed files with 34 additions and 43 deletions

View File

@@ -1457,8 +1457,8 @@ export async function getServiceFromDB({
if (!body) {
return null
}
let { type } = body;
type = fixType(type);
body.type = fixType(body.type);
if (body?.serviceSecret.length > 0) {
body.serviceSecret = body.serviceSecret.map((s) => {
s.value = decrypt(s.value);
@@ -1466,7 +1466,6 @@ export async function getServiceFromDB({
});
}
// body[type] = { ...body[type], ...getUpdateableFields(type, body[type]) };
return { ...body, settings };
}
@@ -1532,10 +1531,7 @@ export function getUpdateableFields(type: string, data: any) {
}
export function fixType(type) {
// Hack to fix the type case sensitivity...
if (type === 'plausibleanalytics') type = 'plausibleAnalytics';
if (type === 'meilisearch') type = 'meiliSearch';
return type;
return type?.replaceAll(' ', '').toLowerCase() || null;
}
export const getServiceMainPort = (service: string) => {