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