mirror of
https://github.com/pinry/pinry.git
synced 2025-11-16 09:55:50 +01:00
Feature: Add update trigger for board-creation
This commit is contained in:
committed by
Isaac Bythewood
parent
68638deeb3
commit
e56e315723
@@ -54,6 +54,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import API from './api';
|
import API from './api';
|
||||||
import ModelForm from './utils/ModelForm';
|
import ModelForm from './utils/ModelForm';
|
||||||
|
import bus from './utils/bus';
|
||||||
|
|
||||||
const fields = ['name'];
|
const fields = ['name'];
|
||||||
|
|
||||||
@@ -110,6 +111,7 @@ export default {
|
|||||||
const promise = API.Board.create(this.createModel.form.name.value);
|
const promise = API.Board.create(this.createModel.form.name.value);
|
||||||
promise.then(
|
promise.then(
|
||||||
(resp) => {
|
(resp) => {
|
||||||
|
bus.bus.$emit(bus.events.refreshBoards);
|
||||||
self.$emit('boardCreated', resp);
|
self.$emit('boardCreated', resp);
|
||||||
self.$parent.close();
|
self.$parent.close();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ import noMore from './noMore.vue';
|
|||||||
import scroll from './utils/scroll';
|
import scroll from './utils/scroll';
|
||||||
import placeholder from '../assets/pinry-placeholder.jpg';
|
import placeholder from '../assets/pinry-placeholder.jpg';
|
||||||
import BoardEditorUI from './editors/BoardEditUI.vue';
|
import BoardEditorUI from './editors/BoardEditUI.vue';
|
||||||
|
import bus from './utils/bus';
|
||||||
|
|
||||||
function createBoardItem(board) {
|
function createBoardItem(board) {
|
||||||
const defaultPreviewImage = placeholder;
|
const defaultPreviewImage = placeholder;
|
||||||
@@ -194,6 +195,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
bus.bus.$on(bus.events.refreshBoards, this.reset);
|
||||||
this.registerScrollEvent();
|
this.registerScrollEvent();
|
||||||
this.initialize();
|
this.initialize();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,5 +6,6 @@ export default {
|
|||||||
bus: eventBus,
|
bus: eventBus,
|
||||||
events: {
|
events: {
|
||||||
refreshPin: 'refreshPin',
|
refreshPin: 'refreshPin',
|
||||||
|
refreshBoards: 'refreshBoards',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user