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

View File

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