Skip to content

Commit

Permalink
Revert "Update Event to ESL (#225)" (#226)
Browse files Browse the repository at this point in the history
This reverts commit f216bfb.
  • Loading branch information
apganapa-adobe authored Sep 25, 2024
1 parent f216bfb commit 1ff4463
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ecc/scripts/esp-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ export async function updateSpeaker(profile, seriesId) {
}

export async function updateEvent(eventId, payload) {
const { host } = getAPIConfig().esl[ECC_ENV];
const { host } = getAPIConfig().esp[ECC_ENV];
const raw = JSON.stringify({ ...payload, liveUpdate: false });
const options = await constructRequestOptions('PUT', raw);

Expand All @@ -544,15 +544,15 @@ export async function updateEvent(eventId, payload) {
return { ok: response.ok, status: response.status, error: data };
}

return data.espProvider || data;
return data;
} catch (error) {
window.lana?.log(`Failed to update event ${eventId}. Error:`, error);
return { ok: false, status: 'Network Error', error: error.message };
}
}

export async function publishEvent(eventId, payload) {
const { host } = getAPIConfig().esl[ECC_ENV];
const { host } = getAPIConfig().esp[ECC_ENV];
const raw = JSON.stringify({ ...payload, published: true, liveUpdate: true });
const options = await constructRequestOptions('PUT', raw);

Expand All @@ -565,15 +565,15 @@ export async function publishEvent(eventId, payload) {
return { ok: response.ok, status: response.status, error: data };
}

return data.espProvider || data;
return data;
} catch (error) {
window.lana?.log(`Failed to publish event ${eventId}. Error:`, error);
return { ok: false, status: 'Network Error', error: error.message };
}
}

export async function unpublishEvent(eventId, payload) {
const { host } = getAPIConfig().esl[ECC_ENV];
const { host } = getAPIConfig().esp[ECC_ENV];
const raw = JSON.stringify({ ...payload, published: false, liveUpdate: true });
const options = await constructRequestOptions('PUT', raw);

Expand All @@ -586,7 +586,7 @@ export async function unpublishEvent(eventId, payload) {
return { ok: response.ok, status: response.status, error: data };
}

return data.espProvider || data;
return data;
} catch (error) {
window.lana?.log(`Failed to unpublish event ${eventId}. Error:`, error);
return { ok: false, status: 'Network Error', error: error.message };
Expand Down

0 comments on commit 1ff4463

Please sign in to comment.