Subversion Repositories SmartDukaan

Rev

Rev 36452 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36452 Rev 36522
Line 46... Line 46...
46
        let $offerTr = $(this).closest('tr');
46
        let $offerTr = $(this).closest('tr');
47
        let offerId = $offerTr.data('offerid');
47
        let offerId = $offerTr.data('offerid');
48
        let $clicked = $(this);
48
        let $clicked = $(this);
49
        if (confirm("Are your sure you want to process?")) {
49
        if (confirm("Are your sure you want to process?")) {
50
            $clicked.hide();
50
            $clicked.hide();
-
 
51
            $.ajax({
51
            doGetAjaxRequestHandler(`${context}/offer/process/${offerId}`, function () {
52
                url: `${context}/offer/process/${offerId}`,
-
 
53
                type: 'GET',
-
 
54
                success: function () {
-
 
55
                    var now = moment().format("DD/MM/YYYY HH:mm");
-
 
56
                    $offerTr.find('.processed-timestamp').text(now);
-
 
57
                    $clicked.replaceWith('<span style="color:grey;">Processing...</span>');
-
 
58
                },
-
 
59
                error: function (xhr) {
52
                alert("Offer Processed successfully");
60
                    var msg = "Failed to process offer";
-
 
61
                    if (xhr.responseJSON && xhr.responseJSON.response && xhr.responseJSON.response.message) {
-
 
62
                        msg = xhr.responseJSON.response.message;
-
 
63
                    }
-
 
64
                    alert(msg);
53
                $clicked.show();
65
                    $clicked.show();
-
 
66
                }
54
            });
67
            });
55
        }
68
        }
56
    });
69
    });
57
 
70
 
58
    $(document).on('change', 'input[name=schemeType]', function () {
71
    $(document).on('change', 'input[name=schemeType]', function () {