From 04eb7d05567b1d5b3b90ea6fa38d90ff5b06cb15 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 25 Jun 2023 20:13:13 +1200 Subject: [PATCH] Add brew title to Not an Author page --- client/homebrew/pages/errorPage/errors/errorIndex.js | 4 +++- server/homebrew.api.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index 1293858d2..71326190d 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -55,7 +55,9 @@ const errorIndex = (props)=>{ as an author by opening the brew, viewing the Properties tab, and adding your username to the "invited authors" list. You can then try to access this document again. - Current Authors: + **Brew Title:** ${props.brew.brewTitle || 'Unable to show title'} + + **Current Authors:** ${props.brew.authors?.map((author)=>{return `- ${author}`;}).join('\n') || 'Unable to list authors'} `, diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 4c4f10705..462a089b5 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -70,7 +70,7 @@ const api = { if(accessType === 'edit' && (authorsExist && !(isAuthor || isInvited))) { const accessError = { name: 'Access Error', status: 401 }; if(req.account){ - throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors }; + throw { ...accessError, message: 'User is not an Author', HBErrorCode: '03', authors: stub.authors, brewTitle: stub.title }; } throw { ...accessError, message: 'User is not logged in', HBErrorCode: '04' }; }