mirror of
https://github.com/apache/superset.git
synced 2024-09-06 13:57:40 -04:00
fix(dashboard|chart): use correct url for favorite_status and change request type to rison (#13557)
This commit is contained in:
parent
fc345b9ab1
commit
4de6040d89
@ -484,15 +484,15 @@ type FavoriteStatusResponse = {
|
||||
};
|
||||
|
||||
const favoriteApis = {
|
||||
chart: makeApi<string, FavoriteStatusResponse>({
|
||||
requestType: 'search',
|
||||
chart: makeApi<Array<string | number>, FavoriteStatusResponse>({
|
||||
requestType: 'rison',
|
||||
method: 'GET',
|
||||
endpoint: '/api/v1/chart/favorite_status',
|
||||
endpoint: '/api/v1/chart/favorite_status/',
|
||||
}),
|
||||
dashboard: makeApi<string, FavoriteStatusResponse>({
|
||||
requestType: 'search',
|
||||
dashboard: makeApi<Array<string | number>, FavoriteStatusResponse>({
|
||||
requestType: 'rison',
|
||||
method: 'GET',
|
||||
endpoint: '/api/v1/dashboard/favorite_status',
|
||||
endpoint: '/api/v1/dashboard/favorite_status/',
|
||||
}),
|
||||
};
|
||||
|
||||
@ -510,7 +510,7 @@ export function useFavoriteStatus(
|
||||
if (!ids.length) {
|
||||
return;
|
||||
}
|
||||
favoriteApis[type](`q=${rison.encode(ids)}`).then(
|
||||
favoriteApis[type](ids).then(
|
||||
({ result }) => {
|
||||
const update = result.reduce((acc, element) => {
|
||||
acc[element.id] = element.value;
|
||||
@ -524,7 +524,7 @@ export function useFavoriteStatus(
|
||||
),
|
||||
),
|
||||
);
|
||||
}, [ids]);
|
||||
}, [ids, type, handleErrorMsg]);
|
||||
|
||||
const saveFaveStar = useCallback(
|
||||
(id: number, isStarred: boolean) => {
|
||||
|
Loading…
Reference in New Issue
Block a user