Changes to marketplace responses
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
}))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user