mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 09:36:16 +01:00
feat: #8521, allow editing title before posting from queue
This commit is contained in:
@@ -147,7 +147,7 @@ module.exports = function (Posts) {
|
||||
socketHelpers.notifyNew(data.uid, 'newPost', result);
|
||||
}
|
||||
|
||||
Posts.editQueuedContent = async function (uid, id, content) {
|
||||
Posts.editQueuedContent = async function (uid, id, content, title) {
|
||||
const canEditQueue = await Posts.canEditQueue(uid, id);
|
||||
if (!canEditQueue) {
|
||||
throw new Error('[[error:no-privileges]]');
|
||||
@@ -156,7 +156,12 @@ module.exports = function (Posts) {
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
data.data.content = content;
|
||||
if (content !== undefined) {
|
||||
data.data.content = content;
|
||||
}
|
||||
if (title !== undefined) {
|
||||
data.data.title = title;
|
||||
}
|
||||
await db.setObjectField('post:queue:' + id, 'data', JSON.stringify(data.data));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user