Changes to marketplace responses

This commit is contained in:
2026-01-24 09:09:09 -07:00
parent 4f94ee2dd4
commit 93404d9741
2 changed files with 25 additions and 6 deletions

View File

@@ -50,7 +50,16 @@ export async function handler (context: Context) {
if (idQuery || uuidQuery) {
const icon = await db1
.select()
.select({
id: berryDashMarketplaceIcons.id,
userId: berryDashMarketplaceIcons.userId,
data: berryDashMarketplaceIcons.data,
hash: berryDashMarketplaceIcons.hash,
timestamp: berryDashMarketplaceIcons.timestamp,
state: berryDashMarketplaceIcons.state,
price: berryDashMarketplaceIcons.price,
name: berryDashMarketplaceIcons.name
})
.from(berryDashMarketplaceIcons)
.where(
!uuidQuery
@@ -95,6 +104,7 @@ export async function handler (context: Context) {
username: userData[0].username,
userId: icon[0].userId,
data: icon[0].data,
hash: icon[0].hash,
id: icon[0].id,
price: icon[0].price,
buyable: icon[0].state == 1,

View File

@@ -134,7 +134,15 @@ export async function handler (context: Context) {
}
const icons = await db1
.select()
.select({
id: berryDashMarketplaceIcons.id,
userId: berryDashMarketplaceIcons.userId,
hash: berryDashMarketplaceIcons.hash,
timestamp: berryDashMarketplaceIcons.timestamp,
state: berryDashMarketplaceIcons.state,
price: berryDashMarketplaceIcons.price,
name: berryDashMarketplaceIcons.name
})
.from(berryDashMarketplaceIcons)
.where(and(...filters))
.orderBy(orderBy)
@@ -151,10 +159,11 @@ export async function handler (context: Context) {
const result = icons.map(i => ({
username: usersMap[i.userId] ?? 'Unknown',
userid: i.userId,
data: i.data,
uuid: i.uuid,
price: i.state === 2 ? 100000000 : i.price,
userId: i.userId,
hash: i.hash,
id: i.id,
price: i.price,
buyable: i.state == 1,
name: atob(i.name)
}))