File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -283,6 +283,7 @@ export async function forceReject (
283283 )
284284
285285 let shouldRunCleanup
286+ let feedbackThread
286287 const logLocation = template . location ( )
287288
288289 try {
@@ -308,13 +309,17 @@ export async function forceReject (
308309 user : `<@${ submission . authorId } >` ,
309310 name : submission . name
310311 } )
311- await sendMessageToFeedbackThread (
312+ const result = await sendMessageToFeedbackThread (
312313 {
313314 content : templatedReason
314315 } ,
315316 submission
316317 )
317318
319+ if ( result . didMakeThread ) {
320+ feedbackThread = result . thread
321+ }
322+
318323 shouldRunCleanup = true
319324 } else {
320325 shouldRunCleanup = true
@@ -329,6 +334,9 @@ export async function forceReject (
329334 let fields
330335
331336 if ( isValidated ( submission ) ) {
337+ // Mutation of submissions is generally ill advised, but this is only for logging, it does not change the real state.
338+ // The state has already been established in the database, so this only brings the object and DB in sync
339+ submission . feedbackThread = feedbackThread
332340 fields = generateDefaultFields ( submission , true )
333341 } else {
334342 fields = [
You can’t perform that action at this time.
0 commit comments