Use clearer urls fro documents

This commit is contained in:
Jori Lallo
2016-08-15 21:41:51 +02:00
parent 537341c01c
commit 3089ac7bc8
14 changed files with 88 additions and 56 deletions

View File

@@ -67,10 +67,10 @@ class DocumentEditStore {
title: this.title,
text: this.text,
}, { cache: true });
const { id } = data.data;
const { url } = data.data;
this.hasPendingChanges = false;
browserHistory.push(`/documents/${id}`);
browserHistory.push(url);
} catch (e) {
console.error("Something went wrong");
}
@@ -83,14 +83,15 @@ class DocumentEditStore {
this.isSaving = true;
try {
await client.post('/documents.update', {
const data = await client.post('/documents.update', {
id: this.documentId,
title: this.title,
text: this.text,
}, { cache: true });
const { url } = data.data;
this.hasPendingChanges = false;
browserHistory.push(`/documents/${this.documentId}`);
browserHistory.push(url);
} catch (e) {
console.error("Something went wrong");
}