2019-10-20 18:02:52 +02:00
|
|
|
import { apiClient } from "@scm-manager/ui-components";
|
2018-11-26 15:56:41 +01:00
|
|
|
|
|
|
|
|
export function getHistory(url: string) {
|
|
|
|
|
return apiClient
|
|
|
|
|
.get(url)
|
|
|
|
|
.then(response => response.json())
|
|
|
|
|
.then(result => {
|
|
|
|
|
return {
|
2018-11-26 16:39:26 +01:00
|
|
|
changesets: result._embedded.changesets,
|
|
|
|
|
pageCollection: {
|
|
|
|
|
_embedded: result._embedded,
|
|
|
|
|
_links: result._links,
|
|
|
|
|
page: result.page,
|
2019-10-20 18:02:52 +02:00
|
|
|
pageTotal: result.pageTotal
|
|
|
|
|
}
|
2018-11-26 15:56:41 +01:00
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
2019-10-19 16:38:07 +02:00
|
|
|
return {
|
2019-10-20 18:02:52 +02:00
|
|
|
error: err
|
2019-10-19 16:38:07 +02:00
|
|
|
};
|
2018-11-26 15:56:41 +01:00
|
|
|
});
|
|
|
|
|
}
|