This should be fine actually
This commit is contained in:
@@ -39,14 +39,6 @@ export async function handler (context: Context) {
|
||||
const userId = authResult.id
|
||||
|
||||
const body = context.body as Body
|
||||
if (!body.saveData) {
|
||||
connection0.end()
|
||||
connection1.end()
|
||||
return jsonResponse(
|
||||
{ success: false, message: 'No valid save data provided' },
|
||||
400
|
||||
)
|
||||
}
|
||||
|
||||
let userSaveData: any = {}
|
||||
try {
|
||||
|
||||
@@ -73,17 +73,6 @@ export async function handler (context: Context) {
|
||||
const userId = authResult.id
|
||||
|
||||
const body = context.body as Body
|
||||
if (!body.verifyCode && !body.token) {
|
||||
connection0.end()
|
||||
connection1.end()
|
||||
return jsonResponse(
|
||||
{
|
||||
success: false,
|
||||
message: 'verifyCode or token must be provided in POST data'
|
||||
},
|
||||
400
|
||||
)
|
||||
}
|
||||
const price = parseInt(body.price, 10)
|
||||
if (isNaN(price)) {
|
||||
connection0.end()
|
||||
|
||||
@@ -41,14 +41,6 @@ export async function handler (context: Context) {
|
||||
const userId = authResult.id
|
||||
|
||||
const body = context.body as Body
|
||||
if (!body.content) {
|
||||
connection0.end()
|
||||
connection1.end()
|
||||
return jsonResponse(
|
||||
{ success: false, message: 'No valid content provided', data: null },
|
||||
400
|
||||
)
|
||||
}
|
||||
|
||||
await db1
|
||||
.insert(berryDashUserPosts)
|
||||
|
||||
@@ -53,17 +53,6 @@ export async function handler (context: Context) {
|
||||
const userId = authResult.id
|
||||
|
||||
const body = context.body as Body
|
||||
if (!body.token || !body.content) {
|
||||
connection0.end()
|
||||
connection1.end()
|
||||
return jsonResponse(
|
||||
{
|
||||
success: false,
|
||||
message: 'Token and content must be in POST data'
|
||||
},
|
||||
400
|
||||
)
|
||||
}
|
||||
if (body.content.length > 72) {
|
||||
connection0.end()
|
||||
connection1.end()
|
||||
|
||||
Reference in New Issue
Block a user