Release 202506011511
This commit is contained in:
@@ -157,12 +157,6 @@ export const adminServiceActions = {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const imageUrl = input.removeImage
|
|
||||||
? null
|
|
||||||
: input.imageFile
|
|
||||||
? await saveFileLocally(input.imageFile, input.imageFile.name)
|
|
||||||
: undefined
|
|
||||||
|
|
||||||
const existingService = await prisma.service.findUnique({
|
const existingService = await prisma.service.findUnique({
|
||||||
where: { id: input.id },
|
where: { id: input.id },
|
||||||
select: {
|
select: {
|
||||||
@@ -201,6 +195,12 @@ export const adminServiceActions = {
|
|||||||
const attributesToAdd = input.attributes.filter((aId) => !existingAttributeIds.includes(aId))
|
const attributesToAdd = input.attributes.filter((aId) => !existingAttributeIds.includes(aId))
|
||||||
const attributesToRemove = existingAttributeIds.filter((aId) => !input.attributes.includes(aId))
|
const attributesToRemove = existingAttributeIds.filter((aId) => !input.attributes.includes(aId))
|
||||||
|
|
||||||
|
const imageUrl = input.removeImage
|
||||||
|
? null
|
||||||
|
: input.imageFile
|
||||||
|
? await saveFileLocally(input.imageFile, input.imageFile.name)
|
||||||
|
: undefined
|
||||||
|
|
||||||
const {
|
const {
|
||||||
web: serviceUrls,
|
web: serviceUrls,
|
||||||
onion: onionUrls,
|
onion: onionUrls,
|
||||||
|
|||||||
@@ -271,6 +271,7 @@ if (toggleResult?.error) {
|
|||||||
label: type.label,
|
label: type.label,
|
||||||
value: type.value,
|
value: type.value,
|
||||||
icon: type.icon,
|
icon: type.icon,
|
||||||
|
noTransitionPersist: false,
|
||||||
}))}
|
}))}
|
||||||
cardSize="sm"
|
cardSize="sm"
|
||||||
required
|
required
|
||||||
@@ -305,8 +306,8 @@ if (toggleResult?.error) {
|
|||||||
label="Status"
|
label="Status"
|
||||||
error={createInputErrors.isActive}
|
error={createInputErrors.isActive}
|
||||||
options={[
|
options={[
|
||||||
{ label: 'Active', value: 'true' },
|
{ label: 'Active', value: 'true', noTransitionPersist: true },
|
||||||
{ label: 'Inactive', value: 'false' },
|
{ label: 'Inactive', value: 'false', noTransitionPersist: true },
|
||||||
]}
|
]}
|
||||||
selectedValue={newAnnouncement.isActive ? 'true' : 'false'}
|
selectedValue={newAnnouncement.isActive ? 'true' : 'false'}
|
||||||
cardSize="sm"
|
cardSize="sm"
|
||||||
@@ -627,6 +628,7 @@ if (toggleResult?.error) {
|
|||||||
label: type.label,
|
label: type.label,
|
||||||
value: type.value,
|
value: type.value,
|
||||||
icon: type.icon,
|
icon: type.icon,
|
||||||
|
noTransitionPersist: true,
|
||||||
}))}
|
}))}
|
||||||
cardSize="sm"
|
cardSize="sm"
|
||||||
required
|
required
|
||||||
@@ -659,8 +661,8 @@ if (toggleResult?.error) {
|
|||||||
name="isActive"
|
name="isActive"
|
||||||
label="Status"
|
label="Status"
|
||||||
options={[
|
options={[
|
||||||
{ label: 'Active', value: 'true' },
|
{ label: 'Active', value: 'true', noTransitionPersist: true },
|
||||||
{ label: 'Inactive', value: 'false' },
|
{ label: 'Inactive', value: 'false', noTransitionPersist: true },
|
||||||
]}
|
]}
|
||||||
selectedValue={announcement.isActive ? 'true' : 'false'}
|
selectedValue={announcement.isActive ? 'true' : 'false'}
|
||||||
cardSize="sm"
|
cardSize="sm"
|
||||||
|
|||||||
@@ -406,6 +406,7 @@ const apiCalls = await Astro.locals.banners.try(
|
|||||||
value: kycLevel.id.toString(),
|
value: kycLevel.id.toString(),
|
||||||
icon: kycLevel.icon,
|
icon: kycLevel.icon,
|
||||||
description: kycLevel.description,
|
description: kycLevel.description,
|
||||||
|
noTransitionPersist: true,
|
||||||
}))}
|
}))}
|
||||||
selectedValue={service.kycLevel.toString()}
|
selectedValue={service.kycLevel.toString()}
|
||||||
iconSize="md"
|
iconSize="md"
|
||||||
@@ -423,6 +424,7 @@ const apiCalls = await Astro.locals.banners.try(
|
|||||||
icon: status.icon,
|
icon: status.icon,
|
||||||
iconClass: status.classNames.icon,
|
iconClass: status.classNames.icon,
|
||||||
description: status.description,
|
description: status.description,
|
||||||
|
noTransitionPersist: true,
|
||||||
}))}
|
}))}
|
||||||
selectedValue={service.verificationStatus}
|
selectedValue={service.verificationStatus}
|
||||||
error={serviceInputErrors.verificationStatus}
|
error={serviceInputErrors.verificationStatus}
|
||||||
@@ -438,6 +440,7 @@ const apiCalls = await Astro.locals.banners.try(
|
|||||||
label: currency.name,
|
label: currency.name,
|
||||||
value: currency.id,
|
value: currency.id,
|
||||||
icon: currency.icon,
|
icon: currency.icon,
|
||||||
|
noTransitionPersist: true,
|
||||||
}))}
|
}))}
|
||||||
selectedValue={service.acceptedCurrencies}
|
selectedValue={service.acceptedCurrencies}
|
||||||
error={serviceInputErrors.acceptedCurrencies}
|
error={serviceInputErrors.acceptedCurrencies}
|
||||||
@@ -478,6 +481,7 @@ const apiCalls = await Astro.locals.banners.try(
|
|||||||
icon: visibility.icon,
|
icon: visibility.icon,
|
||||||
iconClass: visibility.iconClass,
|
iconClass: visibility.iconClass,
|
||||||
description: visibility.description,
|
description: visibility.description,
|
||||||
|
noTransitionPersist: true,
|
||||||
}))}
|
}))}
|
||||||
selectedValue={service.serviceVisibility}
|
selectedValue={service.serviceVisibility}
|
||||||
error={serviceInputErrors.serviceVisibility}
|
error={serviceInputErrors.serviceVisibility}
|
||||||
|
|||||||
@@ -226,9 +226,24 @@ if (!user) return Astro.rewrite('/404')
|
|||||||
name="type"
|
name="type"
|
||||||
label="Type"
|
label="Type"
|
||||||
options={[
|
options={[
|
||||||
{ label: 'Admin', value: 'admin', icon: 'ri:shield-star-fill' },
|
{
|
||||||
{ label: 'Moderator', value: 'moderator', icon: 'ri:graduation-cap-fill' },
|
label: 'Admin',
|
||||||
{ label: 'Spammer', value: 'spammer', icon: 'ri:alert-fill' },
|
value: 'admin',
|
||||||
|
icon: 'ri:shield-star-fill',
|
||||||
|
noTransitionPersist: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Moderator',
|
||||||
|
value: 'moderator',
|
||||||
|
icon: 'ri:graduation-cap-fill',
|
||||||
|
noTransitionPersist: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Spammer',
|
||||||
|
value: 'spammer',
|
||||||
|
icon: 'ri:alert-fill',
|
||||||
|
noTransitionPersist: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Verified',
|
label: 'Verified',
|
||||||
value: 'verified',
|
value: 'verified',
|
||||||
@@ -419,6 +434,7 @@ if (!user) return Astro.rewrite('/404')
|
|||||||
label: role.label,
|
label: role.label,
|
||||||
value: role.value,
|
value: role.value,
|
||||||
icon: role.icon,
|
icon: role.icon,
|
||||||
|
noTransitionPersist: true,
|
||||||
}))}
|
}))}
|
||||||
required
|
required
|
||||||
cardSize="sm"
|
cardSize="sm"
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
getEventTypeInfo,
|
getEventTypeInfo,
|
||||||
getEventTypeInfoBySlug,
|
getEventTypeInfoBySlug,
|
||||||
} from '../constants/eventTypes'
|
} from '../constants/eventTypes'
|
||||||
|
import { getServiceVisibilityInfo } from '../constants/serviceVisibility'
|
||||||
import { getVerificationStatusInfo } from '../constants/verificationStatus'
|
import { getVerificationStatusInfo } from '../constants/verificationStatus'
|
||||||
import BaseLayout from '../layouts/BaseLayout.astro'
|
import BaseLayout from '../layouts/BaseLayout.astro'
|
||||||
import { cn } from '../lib/cn'
|
import { cn } from '../lib/cn'
|
||||||
@@ -44,6 +45,8 @@ const [services, [dbEvents, totalEvents]] = await Astro.locals.banners.tryMany([
|
|||||||
async () =>
|
async () =>
|
||||||
prisma.service.findMany({
|
prisma.service.findMany({
|
||||||
where: {
|
where: {
|
||||||
|
listedAt: { lte: new Date() },
|
||||||
|
serviceVisibility: { in: ['PUBLIC', 'ARCHIVED'] },
|
||||||
events: {
|
events: {
|
||||||
some: {
|
some: {
|
||||||
visible: true,
|
visible: true,
|
||||||
@@ -72,8 +75,15 @@ const [services, [dbEvents, totalEvents]] = await Astro.locals.banners.tryMany([
|
|||||||
createdAt: {
|
createdAt: {
|
||||||
lte: params.now,
|
lte: params.now,
|
||||||
},
|
},
|
||||||
...(params.service ? { service: { slug: params.service } } : {}),
|
service: {
|
||||||
...(params.type ? { type: getEventTypeInfoBySlug(params.type).id } : {}),
|
slug: params.service ?? undefined,
|
||||||
|
listedAt: params.service ? undefined : { lte: new Date() },
|
||||||
|
serviceVisibility: {
|
||||||
|
in: params.service ? ['PUBLIC', 'ARCHIVED', 'UNLISTED'] : ['PUBLIC', 'ARCHIVED'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
type: params.type ? getEventTypeInfoBySlug(params.type).id : undefined,
|
||||||
|
|
||||||
...(params.from || params.to
|
...(params.from || params.to
|
||||||
? {
|
? {
|
||||||
OR: [
|
OR: [
|
||||||
@@ -105,6 +115,7 @@ const [services, [dbEvents, totalEvents]] = await Astro.locals.banners.tryMany([
|
|||||||
name: true,
|
name: true,
|
||||||
imageUrl: true,
|
imageUrl: true,
|
||||||
verificationStatus: true,
|
verificationStatus: true,
|
||||||
|
serviceVisibility: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -126,6 +137,7 @@ const events = orderBy(
|
|||||||
service: {
|
service: {
|
||||||
...event.service,
|
...event.service,
|
||||||
verificationStatusInfo: getVerificationStatusInfo(event.service.verificationStatus),
|
verificationStatusInfo: getVerificationStatusInfo(event.service.verificationStatus),
|
||||||
|
serviceVisibilityInfo: getServiceVisibilityInfo(event.service.serviceVisibility),
|
||||||
},
|
},
|
||||||
})),
|
})),
|
||||||
['actualEndedAt', 'startedAt'],
|
['actualEndedAt', 'startedAt'],
|
||||||
@@ -416,6 +428,16 @@ const createUrlWithoutFilter = (paramName: keyof typeof params) => {
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{event.service.serviceVisibility === 'ARCHIVED' && (
|
||||||
|
<Icon
|
||||||
|
name={event.service.serviceVisibilityInfo.icon}
|
||||||
|
class={cn(
|
||||||
|
'ms-1 inline-block size-3 shrink-0',
|
||||||
|
event.service.serviceVisibilityInfo.iconClass
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{event.source && (
|
{event.source && (
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ const {
|
|||||||
'min-score': { if: 'default' },
|
'min-score': { if: 'default' },
|
||||||
'user-rating': { if: 'default' },
|
'user-rating': { if: 'default' },
|
||||||
'max-kyc': { if: 'default' },
|
'max-kyc': { if: 'default' },
|
||||||
|
'sort-seed': { if: 'another-is-unset', prop: 'page' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user