Initial work on moving domain view to vue
This commit is contained in:
@@ -14,6 +14,28 @@ function create(origin, accessToken) {
|
||||
if (error || result.status !== 200) return [error || result];
|
||||
return [null, result.body];
|
||||
},
|
||||
async prepareDomain(domain) {
|
||||
let error, result;
|
||||
try {
|
||||
result = await fetcher.post(`${origin}/api/v1/dashboard/prepare_location`, { domain }, { access_token: accessToken });
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
if (error || result.status !== 202) return [error || result];
|
||||
return [null, result.body.taskId];
|
||||
},
|
||||
async setDomain(domain) {
|
||||
let error, result;
|
||||
try {
|
||||
result = await fetcher.post(`${origin}/api/v1/dashboard/location`, { domain }, { access_token: accessToken });
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
if (error || result.status !== 204) return [error || result];
|
||||
return [null];
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user