mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-25 23:54:55 +01:00
Complete rename
This commit is contained in:
parent
ce05cc3d18
commit
b67e88f3dc
@ -34,8 +34,7 @@ export default class RestClient implements Client {
|
|||||||
// All was ok, let's sent to success page ...;
|
// All was ok, let's sent to success page ...;
|
||||||
success();
|
success();
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
const response = error.response;
|
const errorInfo = this.parseResponseOnError(error.response);
|
||||||
const errorInfo = this.parseResponseOnError(response);
|
|
||||||
reject(errorInfo);
|
reject(errorInfo);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -62,7 +61,25 @@ export default class RestClient implements Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renameMap(id: number, basicInfo: BasicMapInfo): Promise<void> {
|
renameMap(id: number, basicInfo: BasicMapInfo): Promise<void> {
|
||||||
throw "Method not implemented yet";
|
const handler = (success: () => void, reject: (error: ErrorInfo) => void) => {
|
||||||
|
axios.put(`${this.baseUrl}/c/restful/maps/${id}/title`,
|
||||||
|
basicInfo.title,
|
||||||
|
{ headers: { 'Content-Type': 'text/plain' } }
|
||||||
|
).then(() => {
|
||||||
|
return axios.put(`${this.baseUrl}/c/restful/maps/${id}/description`,
|
||||||
|
basicInfo.description,
|
||||||
|
{ headers: { 'Content-Type': 'text/plain' } }
|
||||||
|
)
|
||||||
|
}).then(() => {
|
||||||
|
// All was ok, let's sent to success page ...;
|
||||||
|
success();
|
||||||
|
}).catch(error => {
|
||||||
|
const response = error.response;
|
||||||
|
const errorInfo = this.parseResponseOnError(response);
|
||||||
|
reject(errorInfo);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return new Promise(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
createMap(model: BasicMapInfo): Promise<number> {
|
createMap(model: BasicMapInfo): Promise<number> {
|
||||||
|
Loading…
Reference in New Issue
Block a user