[Messaging] Fix duplicate messageChannelMessage (#3616)

* [Messaging] Fix duplicate channelMessageChannel

* add messageChannelMessage check before querying gmail

* rename messageChannelMessage to messageChannelMessageAssociation
This commit is contained in:
Weiko
2024-01-25 14:15:57 +01:00
committed by GitHub
parent 7845e04f6b
commit 6d997edabb
9 changed files with 87 additions and 34 deletions

View File

@ -1,4 +1,4 @@
import { Inject, Injectable } from '@nestjs/common';
import { ConflictException, Inject, Injectable } from '@nestjs/common';
import { v4 } from 'uuid';
@ -48,9 +48,7 @@ export class GoogleGmailService {
);
if (connectedAccount.length > 0) {
console.log('This account is already connected to your workspace.');
return;
throw new ConflictException('Connected account already exists');
}
const connectedAccountId = v4();