diff --git a/pinry-spa/src/components/PHeader.vue b/pinry-spa/src/components/PHeader.vue index a74a3df..f5f97ec 100644 --- a/pinry-spa/src/components/PHeader.vue +++ b/pinry-spa/src/components/PHeader.vue @@ -127,8 +127,6 @@ export default { onSignUpSucceed() { this.initializeUser(true); }, - onPinCreated() { - }, logOut() { api.User.logOut().then( () => { @@ -140,9 +138,8 @@ export default { modals.openLogin(this, this.onLoginSucceed); }, createPin() { - modals.openPinCreate( + modals.openPinEdit( this, - this.onPinCreated, { username: this.user.meta.username }, ); }, diff --git a/pinry-spa/src/components/api.js b/pinry-spa/src/components/api.js index 20e981c..cce9f82 100644 --- a/pinry-spa/src/components/api.js +++ b/pinry-spa/src/components/api.js @@ -92,6 +92,13 @@ const Pin = { url, ); }, + updateById(pinId, data) { + const url = `${API_PREFIX}pins/${pinId}/`; + return axios.patch( + url, + data, + ); + }, }; diff --git a/pinry-spa/src/components/editors/PinEditorUI.vue b/pinry-spa/src/components/editors/PinEditorUI.vue index 605e609..3b56460 100644 --- a/pinry-spa/src/components/editors/PinEditorUI.vue +++ b/pinry-spa/src/components/editors/PinEditorUI.vue @@ -22,7 +22,7 @@ custom-size="mdi-24px"> - +