This commit is contained in:
@@ -3492,9 +3492,18 @@ app.get('/api/public/review/:token', async (req, res) => {
|
||||
limit: 1000,
|
||||
});
|
||||
|
||||
// Resolve approver names
|
||||
const approvers = [];
|
||||
if (artefact.approver_ids) {
|
||||
for (const id of artefact.approver_ids.split(',').filter(Boolean)) {
|
||||
approvers.push({ id: Number(id), name: await getRecordName('Users', Number(id)) });
|
||||
}
|
||||
}
|
||||
|
||||
res.json({
|
||||
...artefact,
|
||||
brand_name: await getRecordName('Brands', artefact.brand_id),
|
||||
approvers,
|
||||
version: versionData,
|
||||
version_number: reviewVersionNumber,
|
||||
texts,
|
||||
@@ -3569,7 +3578,7 @@ app.post('/api/public/review/:token/reject', async (req, res) => {
|
||||
});
|
||||
|
||||
app.post('/api/public/review/:token/revision', async (req, res) => {
|
||||
const { feedback } = req.body;
|
||||
const { feedback, approved_by_name } = req.body;
|
||||
try {
|
||||
const artefacts = await nocodb.list('Artefacts', {
|
||||
where: `(approval_token,eq,${req.params.token})`,
|
||||
@@ -3586,6 +3595,7 @@ app.post('/api/public/review/:token/revision', async (req, res) => {
|
||||
|
||||
await nocodb.update('Artefacts', artefact.Id, {
|
||||
status: 'revision_requested',
|
||||
approved_by_name: approved_by_name || '',
|
||||
feedback: feedback || '',
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user