added pargar accounting
This commit is contained in:
@@ -111,26 +111,32 @@ function handelRemoveFile(index: number, size: string) {
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!id) {
|
||||
message.error('شناسه بنر یافت نشد؛ صفحه را رفرش کنید')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await updateBannerConst({
|
||||
id: 14,
|
||||
id,
|
||||
value: JSON.stringify(benefitsList.value),
|
||||
key: "header_banner"
|
||||
key: 'header_banner',
|
||||
})
|
||||
message.success("اطلاعات با موفقیت ذخیره شد")
|
||||
message.success('اطلاعات با موفقیت ذخیره شد')
|
||||
} catch (error) {
|
||||
message.error("خطا در ذخیره اطلاعات")
|
||||
message.error('خطا در ذخیره اطلاعات')
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const res = await getHeaderBannerConst()
|
||||
|
||||
if (res?.length > 0) {
|
||||
id = res[0].id || res[0].const_id || null
|
||||
benefitsList.value = parseBannerList(res[0].value)
|
||||
if (!res) {
|
||||
return
|
||||
}
|
||||
|
||||
id = res.id ?? res.const_id ?? null
|
||||
benefitsList.value = parseBannerList(res.value)
|
||||
} catch (error) {
|
||||
console.error('خطا در دریافت بنرها:', error)
|
||||
}
|
||||
@@ -151,4 +157,4 @@ onMounted(async () => {
|
||||
overflow-y: auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user