mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-15 11:37:57 +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> {
|
updateStarred(id: number, starred: boolean): Promise<void> {
|
||||||
|
|
||||||
|
console.debug(`Starred ${starred}`)
|
||||||
const handler = (success: () => void, reject: (error: ErrorInfo) => void) => {
|
const handler = (success: () => void, reject: (error: ErrorInfo) => void) => {
|
||||||
axios
|
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' },
|
headers: { 'Content-Type': 'text/plain' },
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
@ -338,6 +338,12 @@ export const MapsList = (props: MapsListProps): React.ReactElement => {
|
|||||||
const starredMultation = useMutation<void, ErrorInfo, number>(
|
const starredMultation = useMutation<void, ErrorInfo, number>(
|
||||||
(id: number) => {
|
(id: number) => {
|
||||||
const map = mapsInfo.find((m) => m.id == id);
|
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);
|
return client.updateStarred(id, !map?.starred);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user