fix: resolve ts errors for build and cleanup widget partners action

This commit is contained in:
AyrisAI
2026-07-13 14:25:28 +03:00
parent 53cbee0841
commit f37d2b4c39
6 changed files with 37 additions and 176 deletions
+29 -3
View File
@@ -6,6 +6,8 @@ export interface Category {
nameTr: string
nameEn: string
nameRu: string
createdAt: Date
updatedAt: Date
}
export interface Neighborhood {
@@ -196,9 +198,9 @@ const globalForMockDb = globalThis as unknown as {
if (!globalForMockDb.initialized || globalForMockDb.__version !== MOCK_DB_VERSION) {
globalForMockDb.categories = [
{ id: 'cat-1', slug: 'restoran', nameTr: 'Restoran', nameEn: 'Restaurant', nameRu: 'Ресторан' },
{ id: 'cat-2', slug: 'apart', nameTr: 'Apart', nameEn: 'Apart Hotel', nameRu: 'Апарт-отель' },
{ id: 'cat-3', slug: 'isletme', nameTr: 'İşletme & Hizmet', nameEn: 'Business & Service', nameRu: 'Бизнес и Услуги' }
{ id: 'cat-1', slug: 'restoran', nameTr: 'Restoran', nameEn: 'Restaurant', nameRu: 'Ресторан', createdAt: new Date(), updatedAt: new Date() },
{ id: 'cat-2', slug: 'apart', nameTr: 'Apart', nameEn: 'Apart Hotel', nameRu: 'Апарт-отель', createdAt: new Date(), updatedAt: new Date() },
{ id: 'cat-3', slug: 'isletme', nameTr: 'İşletme & Hizmet', nameEn: 'Business & Service', nameRu: 'Бизнес и Услуги', createdAt: new Date(), updatedAt: new Date() }
]
globalForMockDb.neighborhoods = [
@@ -974,6 +976,18 @@ export const mockDb = {
return db.businessSubmission.findMany({ orderBy: { createdAt: 'desc' } })
},
async deleteSubmission(id: string) {
if (this.isMock()) {
const idx = globalForMockDb.submissions.findIndex(s => s.id === id)
if (idx !== -1) {
globalForMockDb.submissions.splice(idx, 1)
return true
}
return false
}
await db.businessSubmission.delete({ where: { id } })
},
async createSubmission(data: Omit<BusinessSubmission, 'id' | 'status' | 'createdAt' | 'updatedAt'>) {
if (this.isMock()) {
const newSub: BusinessSubmission = {
@@ -1020,6 +1034,18 @@ export const mockDb = {
return db.contactMessage.findMany({ orderBy: { createdAt: 'desc' } })
},
async deleteMessage(id: string) {
if (this.isMock()) {
const idx = globalForMockDb.messages.findIndex(m => m.id === id)
if (idx !== -1) {
globalForMockDb.messages.splice(idx, 1)
return true
}
return false
}
await db.contactMessage.delete({ where: { id } })
},
async createMessage(data: Omit<ContactMessage, 'id' | 'isRead' | 'createdAt' | 'updatedAt'>) {
if (this.isMock()) {
const newMsg: ContactMessage = {