Skip to content

Commit 3f9aa15

Browse files
authored
Merge pull request #1577 from nextcloud/fix/1502
fix: Update internalPath after updating title
2 parents 5013f5f + 3327599 commit 3f9aa15

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/Controller/NotesController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,10 @@ public function updateProperty(
277277
$note->setTitle($title);
278278
});
279279
}
280-
$result = $note->getTitle();
280+
$result = [
281+
'title' => $note->getTitle(),
282+
'internalPath' => $note->getData()['internalPath'], // based on the title
283+
];
281284
break;
282285

283286
case 'category':

src/NotesService.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ export const setTitle = (noteId, title) => {
183183
return axios
184184
.put(url('/notes/' + noteId + '/title'), { title })
185185
.then(response => {
186-
store.commit('setNoteAttribute', { noteId, attribute: 'title', value: response.data })
186+
store.commit('setNoteAttribute', { noteId, attribute: 'title', value: response.data.title })
187+
// need to update the internal path as well since sharing sidebar uses it
188+
store.commit('setNoteAttribute', { noteId, attribute: 'internalPath', value: response.data?.internalPath })
187189
})
188190
.catch(err => {
189191
console.error(err)

0 commit comments

Comments
 (0)