mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-05-24 01:12:54 -04:00
* Add clearable to RecipeRating, Fix #2534 * Make rating nullable --------- Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
parent
2dfbe9f08d
commit
9a04b11ee5
@ -10,6 +10,7 @@
|
||||
:size="small ? 15 : undefined"
|
||||
hover
|
||||
:value="value"
|
||||
clearable
|
||||
@input="updateRating"
|
||||
@click="updateRating"
|
||||
></v-rating>
|
||||
@ -52,7 +53,10 @@ export default defineComponent({
|
||||
const rating = ref(props.value);
|
||||
|
||||
const api = useUserApi();
|
||||
function updateRating(val: number) {
|
||||
function updateRating(val: number | null) {
|
||||
if (val === 0) {
|
||||
val = null;
|
||||
}
|
||||
if (!props.emitOnly) {
|
||||
api.recipes.patchOne(props.slug, {
|
||||
rating: val,
|
||||
|
@ -206,7 +206,7 @@ export interface Recipe {
|
||||
recipeCategory?: RecipeCategory[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
rating?: number | null;
|
||||
orgURL?: string;
|
||||
dateAdded?: string;
|
||||
dateUpdated?: string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user