Skip to content

Commit

Permalink
Misc JS cleanup
Browse files Browse the repository at this point in the history
Move `updateSoftwareSelection` to BFF, and rename `post` to `post_request` to match other request formats.
  • Loading branch information
UpstreamData committed Aug 27, 2024
1 parent 28b2913 commit c5d426b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion goosebit/ui/static/js/rollouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ async function createRollout() {
const software_id = document.getElementById("selected-sw").value;

try {
await post("/ui/bff/rollouts", { name, feed, software_id });
await post_request("/ui/bff/rollouts", { name, feed, software_id });
} catch (error) {
console.error("Rollout creation failed:", error);
}
Expand Down
5 changes: 2 additions & 3 deletions goosebit/ui/static/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function secondsToRecentDate(t) {

async function updateSoftwareSelection(addSpecialMode = false) {
try {
const response = await fetch("/api/v1/software");
const response = await fetch("/ui/bff/software");
if (!response.ok) {
console.error("Retrieving software list failed.");
return;
Expand Down Expand Up @@ -55,8 +55,7 @@ async function updateSoftwareSelection(addSpecialMode = false) {
}
}

// TODO: rename this function
async function post(url, object) {
async function post_request(url, object) {
const response = await fetch(url, {
method: "POST",
headers: { "Content-Type": "application/json" },
Expand Down

0 comments on commit c5d426b

Please sign in to comment.