mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 09:23:51 +00:00
fix merge
This commit is contained in:
@@ -276,7 +276,7 @@ export const parseJson = async (jsonData): Promise<DatabaseModel | null> => {
|
||||
// Import OSC settings if any
|
||||
returnData.osc = parseOsc(jsonData) ?? dbModel.osc;
|
||||
// Import HTTP settings if any
|
||||
returnData.http = parseHttp(jsonData, enforce);
|
||||
returnData.http = parseHttp(jsonData) ?? dbModel.http;
|
||||
|
||||
return returnData as DatabaseModel;
|
||||
};
|
||||
|
||||
@@ -245,12 +245,7 @@ export const validateHttpObject = (data: Subscription): boolean => {
|
||||
* @param {boolean} enforce - whether to create a definition if one is missing
|
||||
* @returns {object} - event object data
|
||||
*/
|
||||
export const parseHttp = (
|
||||
data: {
|
||||
http?: Partial<HTTPSettings>;
|
||||
},
|
||||
enforce: boolean,
|
||||
): HTTPSettings | Record<string, never> => {
|
||||
export const parseHttp = (data: { http?: Partial<HTTPSettings> }): HTTPSettings => {
|
||||
if ('http' in data) {
|
||||
console.log('Found HTTP definition, importing...');
|
||||
|
||||
@@ -263,15 +258,9 @@ export const parseHttp = (
|
||||
enabledOut: loadedConfig.enabledOut ?? dbModel.http.enabledOut,
|
||||
subscriptions: validatedSubscriptions,
|
||||
};
|
||||
} else if (enforce) {
|
||||
console.log('Created HTTP object in db');
|
||||
return { ...dbModel.http };
|
||||
} else return {};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Parse aliases portion of an entry
|
||||
* @param {object} data - data object
|
||||
|
||||
Reference in New Issue
Block a user