Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Update Event to ESL" #226

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading