Skip to content

Commit

Permalink
CheckSettings.ts: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
allgood committed Aug 23, 2024
1 parent dbda77d commit 719240c
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions backend/src/helpers/CheckSettings.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import Setting from "../models/Setting";
import AppError from "../errors/AppError";

const CheckSettings = async (key: string, defaultValue: string = null ): Promise<string> => {
const CheckSettings = async (
key: string,
defaultValue: string = null
): Promise<string> => {
const setting = await Setting.findOne({
where:
{
companyId: 1,
key
}
where: {
companyId: 1,
key
}
});

if (!setting && !defaultValue) {
Expand All @@ -17,13 +19,16 @@ const CheckSettings = async (key: string, defaultValue: string = null ): Promise
return setting?.value || defaultValue;
};

export const GetCompanySetting = async (companyId: number, key: string, defaultValue: string = null ): Promise<string> => {
export const GetCompanySetting = async (
companyId: number,
key: string,
defaultValue: string = null
): Promise<string> => {
const setting = await Setting.findOne({
where:
{
companyId,
key
}
where: {
companyId,
key
}
});

if (!setting && !defaultValue) {
Expand All @@ -33,5 +38,4 @@ export const GetCompanySetting = async (companyId: number, key: string, defaultV
return setting?.value || defaultValue;
};


export default CheckSettings;

0 comments on commit 719240c

Please sign in to comment.