mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 06:37:56 +01:00
chpres: Add debug info for debug starred.
This commit is contained in:
parent
0ff867a5d7
commit
9b737d607a
@ -434,9 +434,11 @@ export default class RestClient implements Client {
|
||||
}
|
||||
|
||||
updateStarred(id: number, starred: boolean): Promise<void> {
|
||||
|
||||
console.debug(`Starred ${starred}`)
|
||||
const handler = (success: () => void, reject: (error: ErrorInfo) => void) => {
|
||||
axios
|
||||
.put(`${this.baseUrl}/c/restful/maps/${id}/starred`, Boolean(starred), {
|
||||
.put(`${this.baseUrl}/c/restful/maps/${id}/starred`, starred, {
|
||||
headers: { 'Content-Type': 'text/plain' },
|
||||
})
|
||||
.then(() => {
|
||||
|
@ -338,6 +338,12 @@ export const MapsList = (props: MapsListProps): React.ReactElement => {
|
||||
const starredMultation = useMutation<void, ErrorInfo, number>(
|
||||
(id: number) => {
|
||||
const map = mapsInfo.find((m) => m.id == id);
|
||||
if(!map){
|
||||
console.error(`Map ${id} could not be found.`);
|
||||
console.error(`MapsInfo ${mapsInfo} list`);
|
||||
}
|
||||
console.debug(`Starred value map?.starred: ${map?.starred}`);
|
||||
|
||||
return client.updateStarred(id, !map?.starred);
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user