Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data() {
- return {
- sellers: []
- }
- },
- mounted() {
- this.getAllSellers()
- },
- methods: {
- deleteSeller: function(seller_name) {
- // removed notification
- var removed_not = new Noty({
- type: "success",
- layout: "topRight",
- text: '<i class="fas fa-check"></i> Sprzedawca ' + seller_name + " został usunięty z listy",
- timeout: 4000,
- progressBar: true,
- killer: true,
- })
- var sellers = this.sellers
- // confirm notification
- var confirm_not = new Noty({
- type: "info",
- layout: "topCenter",
- text: 'Usunąć ' + seller_name + " z listy sprzedawców?",
- closeWith: ["button"],
- killer: true,
- buttons: [
- Noty.button('Anuluj', 'button modal-edit-button', function () {
- confirm_not.close()
- }),
- Noty.button('Zatwierdź', 'button modal-confirm-button', function () {
- Vue.http.delete("http://192.168.1.148:8000/api/seller/" + seller_name)
- .then((res) => {
- var seller_index = sellers.indexOf(seller_name)
- if (seller_index > -1) {
- sellers.splice(seller_index, 1)
- }
- this.sellers = sellers <--------------------- NIE DZIAŁA, A FAJNIE BYŁOBY GDYBY DZIAŁAŁO
- removed_not.show()
- })
- .catch((err) => {
- // error notification
- var error_not = new Noty({
- type: "error",
- layout: "topRight",
- text: '<i class="fas fa-exclamation"></i> Nie udało się usunąć sprzedawcy',
- timeout: 4000,
- progressBar: true,
- killer: true,
- })
- error_not.show()
- console.log(err)
- })
- }, {id: 'button1', 'data-status': 'ok'})
- ]
- });
- confirm_not.show()
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement