stash
This commit is contained in:
parent
8cba1f52e8
commit
ebd0db4b43
27 changed files with 326 additions and 329 deletions
|
|
@ -152,7 +152,7 @@ export default {
|
|||
const unreachable = new NeighborsCache();
|
||||
const servers = await this.lookupServer({username: this.username}).then(servers => new ServerSet(servers, unreachable))
|
||||
const auth = createSignAuth(this.username, this.keypair.signSk);
|
||||
const reply = await servers.getRaw(auth, '/api/friends/');
|
||||
const reply = await servers.getRaw(auth, '/api/v1/friends/');
|
||||
if (reply.status === 200) {
|
||||
this.setUserFromIdentityRecord({username: this.username, keypair: this.keypair});
|
||||
router.push({path: '/'});
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ export default {
|
|||
}
|
||||
try {
|
||||
const servers = await this.getHomeServers();
|
||||
const response = await servers.delete(this.signAuth, '/api/account/');
|
||||
const response = await servers.delete(this.signAuth, '/api/v1/account/');
|
||||
if (!response || !response.ok) {
|
||||
const errorBody = response ? await response.json().catch(() => ({})) : {};
|
||||
alert('Account deletion failed: ' + (errorBody.detail || response?.statusText || 'unknown error'));
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ export default {
|
|||
}
|
||||
try {
|
||||
const servers = await this.getHomeServers();
|
||||
const response = await servers.delete(this.signAuth, '/api/account_data/');
|
||||
const response = await servers.delete(this.signAuth, '/api/v1/account_data/');
|
||||
if (!response || !response.ok) {
|
||||
const errorBody = response ? await response.json().catch(() => ({})) : {};
|
||||
alert('Data deletion failed: ' + (errorBody.detail || response?.statusText || 'unknown error'));
|
||||
|
|
@ -148,7 +148,7 @@ export default {
|
|||
try {
|
||||
const base64 = await this.fileToBase64(this.selectedFile);
|
||||
const servers = await this.getHomeServers();
|
||||
const summary = await servers.post(this.signAuth, '/api/import/', {zip: base64});
|
||||
const summary = await servers.post(this.signAuth, '/api/v1/import/', {zip: base64});
|
||||
if (summary && summary.detail) {
|
||||
alert('Data import failed: ' + summary.detail);
|
||||
return;
|
||||
|
|
@ -172,7 +172,7 @@ export default {
|
|||
},
|
||||
async exportData() {
|
||||
const servers = await this.getHomeServers();
|
||||
const data = await servers.getRaw(this.signAuth, '/api/export/');
|
||||
const data = await servers.getRaw(this.signAuth, '/api/v1/export/');
|
||||
const blob = new Blob([await data.blob()], {type: 'application/zip'});
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue