Skip to content

Commit 356ba0c

Browse files
committed
feat(posts): migrate updateThreadTitle
1 parent a07ae38 commit 356ba0c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/views/Posts.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,16 @@ export default {
792792
const promise = thread.sticky ? threadsApi.unsticky(thread.id) : threadsApi.sticky(thread.id)
793793
promise.then(() => thread.sticky = !thread.sticky)
794794
}
795-
const updateThreadTitle = () => console.log('updateThreadTitle')
795+
const updateThreadTitle = () => {
796+
var title = ctrl.thread.title;
797+
return Threads.title({id: ctrl.thread.id}, {title: title}).$promise
798+
.then(function() { ctrl.editThread = false; })
799+
.then(function() {
800+
Alert.success('Thread\'s title changed to: ' + title);
801+
BreadcrumbSvc.updateLabelInPlace(title);
802+
})
803+
.catch(function() { Alert.error('Error changing thread title'); });
804+
}
796805
const closeEditThread = () => console.log('closeEditThread')
797806
const createPoll = () => console.log('createPoll')
798807
const showEditDate = (post) => {

0 commit comments

Comments
 (0)