mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-01 02:33:22 -04:00
feat: fix recipe rating overwriting (#1756)
Previously, the recipe-ratings component would not sync to the v-modeled value when doing it's own updating. This PR fixes that issue and ensures that the value is pushed up to the parent whether in emit only mode or not.
This commit is contained in:
@@ -53,13 +53,12 @@ export default defineComponent({
|
||||
|
||||
const api = useUserApi();
|
||||
function updateRating(val: number) {
|
||||
if (props.emitOnly) {
|
||||
context.emit("input", val);
|
||||
return;
|
||||
if (!props.emitOnly) {
|
||||
api.recipes.patchOne(props.slug, {
|
||||
rating: val,
|
||||
});
|
||||
}
|
||||
api.recipes.patchOne(props.slug, {
|
||||
rating: val,
|
||||
});
|
||||
context.emit("input", val);
|
||||
}
|
||||
|
||||
return { loggedIn, rating, updateRating };
|
||||
|
||||
Reference in New Issue
Block a user