Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
k2xl committed Jun 19, 2024
1 parent 98ee875 commit 745e968
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/modal/reportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export default function ReportModal({ targetId, reportType }: ReportModalProps)
},
body: JSON.stringify({
targetId: targetId,
reportReason: 'OTHER',
reportReason: reason,
reportType: reportType,
message: reason,
message: message,
}),
});
const resp = await res.json();
Expand Down Expand Up @@ -131,6 +131,8 @@ export default function ReportModal({ targetId, reportType }: ReportModalProps)
value={message}
placeholder={'Please provide a reason for reporting this ' + reportType.toLocaleLowerCase() + '.'}
onChange={e => setMessage(e.target.value)}
// limit to 500
maxLength={500}
/>
<button
className='bg-blue-500 enabled:hover:bg-blue-600 text-white w-full font-medium py-2 px-3 rounded disabled:opacity-50'
Expand Down
2 changes: 2 additions & 0 deletions models/schemas/reportSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const ReportSchema = new mongoose.Schema<Report>({
type: String,
required: false,
default: '',
// limit to 500 characters
maxlength: 500,
},
});

Expand Down

0 comments on commit 745e968

Please sign in to comment.