Migrate to Turborepo (#1251)

This commit is contained in:
Evan Song
2024-07-04 21:46:29 -07:00
committed by GitHub
parent 6fa1acc461
commit 0f2ddb452c
811 changed files with 5623 additions and 7832 deletions

View File

@@ -0,0 +1,26 @@
export function addReportMessage(thread, report) {
if (!thread || !report) {
return thread
}
if (
!thread.members.some((user) => {
return user.id === report.reporterUser.id
})
) {
thread.members.push(report.reporterUser)
}
if (!thread.messages.some((message) => message.id === 'original')) {
thread.messages.push({
id: 'original',
author_id: report.reporterUser.id,
body: {
type: 'text',
body: report.body,
private: false,
replying_to: null,
},
created: report.created,
})
}
return thread
}