remove unnecessary report api fields
All checks were successful
delpoy / build-and-deploy (push) Successful in 45s
All checks were successful
delpoy / build-and-deploy (push) Successful in 45s
This commit is contained in:
parent
0be3c31b51
commit
676bfc23d8
@ -15,17 +15,10 @@ export const GET = async ({ url }) => {
|
|||||||
const reports = {
|
const reports = {
|
||||||
from_self: await Report.findAll({
|
from_self: await Report.findAll({
|
||||||
where: { reporter_id: user.id },
|
where: { reporter_id: user.id },
|
||||||
include: [
|
include: [{ model: User, as: 'reported' }]
|
||||||
{ model: User, as: 'reporter' },
|
|
||||||
{ model: User, as: 'reported' }
|
|
||||||
]
|
|
||||||
}).then((reports) =>
|
}).then((reports) =>
|
||||||
reports.map((report) => {
|
reports.map((report) => {
|
||||||
return {
|
return {
|
||||||
reporter: {
|
|
||||||
username: report.reporter.username,
|
|
||||||
uuid: report.reporter.uuid
|
|
||||||
},
|
|
||||||
reported: report.reported
|
reported: report.reported
|
||||||
? {
|
? {
|
||||||
username: report.reported.username,
|
username: report.reported.username,
|
||||||
@ -41,10 +34,7 @@ export const GET = async ({ url }) => {
|
|||||||
),
|
),
|
||||||
to_self: await Report.findAll({
|
to_self: await Report.findAll({
|
||||||
where: { reported_id: user.id },
|
where: { reported_id: user.id },
|
||||||
include: [
|
include: [{ model: User, as: 'reporter' }]
|
||||||
{ model: User, as: 'reporter' },
|
|
||||||
{ model: User, as: 'reported' }
|
|
||||||
]
|
|
||||||
}).then((reports) =>
|
}).then((reports) =>
|
||||||
reports.map((report) => {
|
reports.map((report) => {
|
||||||
return {
|
return {
|
||||||
@ -52,10 +42,6 @@ export const GET = async ({ url }) => {
|
|||||||
username: report.reporter.username,
|
username: report.reporter.username,
|
||||||
uuid: report.reporter.uuid
|
uuid: report.reporter.uuid
|
||||||
},
|
},
|
||||||
reported: {
|
|
||||||
username: report.reported.username,
|
|
||||||
uuid: report.reported.uuid
|
|
||||||
},
|
|
||||||
subject: report.subject,
|
subject: report.subject,
|
||||||
draft: report.draft,
|
draft: report.draft,
|
||||||
status: report.status,
|
status: report.status,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user