add isComplete column to response model for better sanity checking
This commit is contained in:
		| @ -14,6 +14,7 @@ const storePromptData = async ( | ||||
|         request: trimInputData(notification.status.content), | ||||
|         to: notification.account.fqn, | ||||
|         isProcessing: false, | ||||
|         isComplete: true, | ||||
|       }, | ||||
|     }); | ||||
|   } catch (error: any) { | ||||
|  | ||||
| @ -17,6 +17,8 @@ const recordPendingResponse = async (notification: Notification) => { | ||||
|     await prisma.response.create({ | ||||
|       data: { | ||||
|         pleromaNotificationId: notification.id, | ||||
|         isProcessing: true, | ||||
|         isComplete: false, | ||||
|       }, | ||||
|     }); | ||||
|   } catch (error: any) { | ||||
| @ -49,9 +51,9 @@ const alreadyRespondedTo = async ( | ||||
| ): Promise<boolean> => { | ||||
|   try { | ||||
|     const duplicate = await prisma.response.findFirst({ | ||||
|       where: { pleromaNotificationId: notification.id, isProcessing: true }, | ||||
|       where: { pleromaNotificationId: notification.id }, | ||||
|     }); | ||||
|     if (duplicate) { | ||||
|     if (duplicate?.isProcessing || duplicate?.isComplete) { | ||||
|       return true; | ||||
|     } | ||||
|     return false; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user