Skip to content

Commit

Permalink
Change not using name=badge_url in form input
Browse files Browse the repository at this point in the history
  • Loading branch information
hakatashi committed Oct 28, 2023
1 parent 881f507 commit fcc4fb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const doAddBadgeForm = ($form, defaultValue, submitCallback) => {
Status badge endpoint. Leave empty to disable.
</small>
</label>
<input type="text" class="form-control" name="badge_url" value="${defaultValue}">
<input type="text" class="form-control tsgctf_badge_url" value="${defaultValue}">
</div>
`;

Expand All @@ -67,7 +67,7 @@ const addBadgeFormEntryNew = ($form) => {
mutations.forEach(async (mutation) => {
if (mutation.attributeName === 'value') {
const challengeId = challengeIdInput.val();
const badgeUrl = $form.find('input[name="badge_url"]').val();
const badgeUrl = $form.find('input.tsgctf_badge_url').val();
if (challengeId !== '') {
const res = await submitBadge(challengeId, badgeUrl, "POST");
if (res.status !== 200) {
Expand Down Expand Up @@ -110,7 +110,7 @@ const addBadgeFormEntryEdit = async ($form) => {
const badgeUrl = res.badge_url;

doAddBadgeForm($form, badgeUrl || '', async () => {
const newBadgeUrl = $('input[name="badge_url"]').val();
const newBadgeUrl = $('input.tsgctf_badge_url').val();
const res = await submitBadge(challengeId, newBadgeUrl, "PATCH");
if (res.status !== 200) {
console.error(`Failed to submit badge: ${res.status}`);
Expand Down

0 comments on commit fcc4fb8

Please sign in to comment.