Skip to content

Commit

Permalink
allow empty titles (better ux)
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyTakanen authored Jul 15, 2023
1 parent f4712b5 commit 7412194
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes/paste.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class Pastes extends Routes {
async newPaste(req: RequestParams[0], res: RequestParams[1]) {
const body = await req.body
const content = body.paste
const title = body.title
if (!body || !content || !title) return this.sendErrorResponse(res, 400, pasteErrors.invalidBody)
const title = body.title // We allow empty titles so this doesn't have to be checked
if (!body || !content) return this.sendErrorResponse(res, 400, pasteErrors.invalidBody)

const authorIdentity = await this.requireAuthentication(req)

Expand Down

0 comments on commit 7412194

Please sign in to comment.