mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-05-31 04:05:33 -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"
|
:size="small ? 15 : undefined"
|
||||||
hover
|
hover
|
||||||
:value="value"
|
:value="value"
|
||||||
|
clearable
|
||||||
@input="updateRating"
|
@input="updateRating"
|
||||||
@click="updateRating"
|
@click="updateRating"
|
||||||
></v-rating>
|
></v-rating>
|
||||||
@ -52,7 +53,10 @@ export default defineComponent({
|
|||||||
const rating = ref(props.value);
|
const rating = ref(props.value);
|
||||||
|
|
||||||
const api = useUserApi();
|
const api = useUserApi();
|
||||||
function updateRating(val: number) {
|
function updateRating(val: number | null) {
|
||||||
|
if (val === 0) {
|
||||||
|
val = null;
|
||||||
|
}
|
||||||
if (!props.emitOnly) {
|
if (!props.emitOnly) {
|
||||||
api.recipes.patchOne(props.slug, {
|
api.recipes.patchOne(props.slug, {
|
||||||
rating: val,
|
rating: val,
|
||||||
|
@ -206,7 +206,7 @@ export interface Recipe {
|
|||||||
recipeCategory?: RecipeCategory[];
|
recipeCategory?: RecipeCategory[];
|
||||||
tags?: RecipeTag[];
|
tags?: RecipeTag[];
|
||||||
tools?: RecipeTool[];
|
tools?: RecipeTool[];
|
||||||
rating?: number;
|
rating?: number | null;
|
||||||
orgURL?: string;
|
orgURL?: string;
|
||||||
dateAdded?: string;
|
dateAdded?: string;
|
||||||
dateUpdated?: string;
|
dateUpdated?: string;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user