mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-12-23 04:03:47 +01:00
chpres: Add debug info for debug starred.
This commit is contained in:
parent
3a87ac4a61
commit
c0887d46d3
@ -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