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