Skip to content

Commit

Permalink
fix js error yuglify
Browse files Browse the repository at this point in the history
  • Loading branch information
sumandari committed Jan 20, 2022
1 parent 32fce95 commit 477db89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 42 deletions.
14 changes: 8 additions & 6 deletions django_project/certification/static/js/certificate_checklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ $('a.archive').click(archiveChecklist);
$('a.activate').click(activateChecklist);

function archiveChecklist() {
const checklist = $.map($(this).closest('li'), function(el, i){
const item = String(el.id).split('-');
var checklist = $.map($(this).closest('li'), function(el, i){
var item = String(el.id).split('-');
return {
'is_archived': true,
'id': item[0],
'question': item[1]
}
});

const data_url = $("#sortable").data("url");
var data_url = $("#sortable").data("url");

if (data_url) {
$.ajax({
url: data_url,
type: "POST",
data: JSON.stringify(checklist),
success: function (response) {
console.log(response);
if($('#archive-saved').is(":visible"))
{
$('#archive-saved').hide();
Expand All @@ -43,23 +44,24 @@ function archiveChecklist() {
}

function activateChecklist() {
const checklist = $.map($(this).closest('li'), function(el, i){
const item = String(el.id).split('-');
var checklist = $.map($(this).closest('li'), function(el, i){
var item = String(el.id).split('-');
return {
'is_archived': false,
'id': item[0],
'question': item[1]
}
});

const data_url = $("#sortable").data("url");
var data_url = $("#sortable").data("url");

if (data_url) {
$.ajax({
url: data_url,
type: "POST",
data: JSON.stringify(checklist),
success: function (response) {
console.log(response);
if($('#archive-saved').is(":visible"))
{
$('#archive-saved').hide();
Expand Down

This file was deleted.

0 comments on commit 477db89

Please sign in to comment.