Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 39x 12x 12x 12x | import { saveFavorite } from "server/features/user/favorite-program-item/favoriteProgramItemRepository";
import { PostFavoriteResponse } from "shared/types/api/favorite";
import { NewFavorite } from "shared/types/models/user";
export const storeFavorite = async (
newFavorite: NewFavorite,
): Promise<PostFavoriteResponse> => {
const saveFavoriteResult = await saveFavorite(newFavorite);
if (!saveFavoriteResult.ok) {
return {
message: "Update favorite failure",
status: "error",
errorId: "unknown",
};
}
return {
message: "Update favorite success",
status: "success",
favoriteProgramItemIds: saveFavoriteResult.value,
};
};
|