حذف بوکمارک
This commit is contained in:
parent
6054491d1b
commit
88721dbb1a
|
@ -1,7 +1,7 @@
|
||||||
export default {
|
export default {
|
||||||
search: {
|
search: {
|
||||||
list: "repo/monir/search/@index_key/@search_type/@type_key/@listkey/@field_collapsed/@offset/@limit/@q=none",
|
list: "repo/monir/search/@index_key/@search_type/@type_key/@listkey/@field_collapsed/@offset/@limit/@q=none",
|
||||||
show: "repo/public/get/byid/@index_key/@id",
|
show: "repo/public/get/byid/@index_key/@id/tbookmark",
|
||||||
synonym: "synonym/get/words",
|
synonym: "synonym/get/words",
|
||||||
prevNextHadith: "monir/next/@index_key/@vol_id/@parag_order/@step",
|
prevNextHadith: "monir/next/@index_key/@vol_id/@parag_order/@step",
|
||||||
getDataTree: "@appname/book/tree/@offset/@limit/@vol_id/@q"
|
getDataTree: "@appname/book/tree/@offset/@limit/@vol_id/@q"
|
||||||
|
|
|
@ -88,16 +88,7 @@ const removeFromFavorites = async (item = {}, index = 0) => {
|
||||||
v-for="(item, index) in props.list"
|
v-for="(item, index) in props.list"
|
||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<div class="flex justify-end mt-2">
|
<div class="flex justify-between mt-4 mb-2">
|
||||||
<UButton
|
|
||||||
v-if="route.name == 'hadithaFavorites'"
|
|
||||||
class=""
|
|
||||||
@click="removeFromFavorites(item)"
|
|
||||||
icon="i-haditha-close"
|
|
||||||
variant=""
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a
|
<a
|
||||||
:href="`/haditha/search/${item?._source?.id}/${
|
:href="`/haditha/search/${item?._source?.id}/${
|
||||||
item?._source?.meta?.hadith_masoum ??
|
item?._source?.meta?.hadith_masoum ??
|
||||||
|
@ -111,6 +102,16 @@ const removeFromFavorites = async (item = {}, index = 0) => {
|
||||||
item?._source?.meta?.hadith_sanad
|
item?._source?.meta?.hadith_sanad
|
||||||
}}
|
}}
|
||||||
</a>
|
</a>
|
||||||
|
<UButton
|
||||||
|
v-if="route.name == 'hadithaFavorites'"
|
||||||
|
@click="removeFromFavorites(item)"
|
||||||
|
variant="ghost"
|
||||||
|
color="error"
|
||||||
|
class="copy-btn"
|
||||||
|
label="حذف"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
@click.prevent="openModal(item)"
|
@click.prevent="openModal(item)"
|
||||||
class="arabic-text block"
|
class="arabic-text block"
|
||||||
|
@ -353,4 +354,28 @@ const removeFromFavorites = async (item = {}, index = 0) => {
|
||||||
.modal-overlay {
|
.modal-overlay {
|
||||||
background: #00000033;
|
background: #00000033;
|
||||||
}
|
}
|
||||||
|
.copy-btn {
|
||||||
|
padding: 0.2em 1em;
|
||||||
|
|
||||||
|
/* width: 44px; */
|
||||||
|
/* height: 24px; */
|
||||||
|
gap: 4px;
|
||||||
|
border-radius: 6px;
|
||||||
|
border-width: 0.5px;
|
||||||
|
padding-top: 4px;
|
||||||
|
padding-right: 12px;
|
||||||
|
padding-bottom: 4px;
|
||||||
|
padding-left: 12px;
|
||||||
|
/* background: #ffffff; */
|
||||||
|
/* border: 0.5px solid #d9d9d9; */
|
||||||
|
|
||||||
|
font-family: IRANSansX;
|
||||||
|
font-weight: 300;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 18px;
|
||||||
|
letter-spacing: 0%;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
/* color: #a71111; */
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -132,6 +132,7 @@ const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const httpService = useNuxtApp()["$http"];
|
const httpService = useNuxtApp()["$http"];
|
||||||
|
const toast = useToast();
|
||||||
|
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
selectedItem: {} as HadithResponseShowModel,
|
selectedItem: {} as HadithResponseShowModel,
|
||||||
|
@ -202,6 +203,21 @@ const addToFavorites = async (item = {}) => {
|
||||||
};
|
};
|
||||||
httpService.postRequest(url, formData).then((res) => {
|
httpService.postRequest(url, formData).then((res) => {
|
||||||
// this.updateListAnswer(index, "tbookmark", 1);
|
// this.updateListAnswer(index, "tbookmark", 1);
|
||||||
|
|
||||||
|
try {
|
||||||
|
toast.add({
|
||||||
|
title: "انجام شد.",
|
||||||
|
description: "به نشان شده ها افزوده شد",
|
||||||
|
color: "success",
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.message);
|
||||||
|
toast.add({
|
||||||
|
title: "انجام شد.",
|
||||||
|
description: "خطایی رخ داد.لطفا دوباره امتحان کنید.",
|
||||||
|
color: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -217,6 +233,21 @@ const removeFromFavorites = async (item = {}, index = 0) => {
|
||||||
};
|
};
|
||||||
httpService.postRequest(url, formData).then((res) => {
|
httpService.postRequest(url, formData).then((res) => {
|
||||||
// this.updateListAnswer(index, "tbookmark", 0);
|
// this.updateListAnswer(index, "tbookmark", 0);
|
||||||
|
|
||||||
|
try {
|
||||||
|
toast.add({
|
||||||
|
title: "انجام شد.",
|
||||||
|
description: "از لیست نشان شده ها حذف شد",
|
||||||
|
color: "success",
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.message);
|
||||||
|
toast.add({
|
||||||
|
title: "انجام شد.",
|
||||||
|
description: "خطایی رخ داد.لطفا دوباره امتحان کنید.",
|
||||||
|
color: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user