4209 speed up gmail full sync by using search params to query only the relevant emails (#4213)
* create blocklist service * blocklist is working on email import in full sync * add log * add blocklist to partial sync * define rule for blocklist imports * gmail filter is working * correct typo * fix bugs * getCompanyNameFromDomainName * renaming * remove unused service * add transaction
This commit is contained in:
@ -5,7 +5,7 @@ import { v4 } from 'uuid';
|
||||
import axios, { AxiosInstance } from 'axios';
|
||||
|
||||
import { CompanyService } from 'src/workspace/messaging/repositories/company/company.service';
|
||||
import { capitalize } from 'src/utils/capitalize';
|
||||
import { getCompanyNameFromDomainName } from 'src/workspace/messaging/utils/get-company-name-from-domain-name.util';
|
||||
@Injectable()
|
||||
export class CreateCompanyService {
|
||||
private readonly httpService: AxiosInstance;
|
||||
@ -100,12 +100,12 @@ export class CreateCompanyService {
|
||||
const data = response.data;
|
||||
|
||||
return {
|
||||
name: data.name,
|
||||
name: data.name ?? getCompanyNameFromDomainName(domainName),
|
||||
city: data.city,
|
||||
};
|
||||
} catch (e) {
|
||||
return {
|
||||
name: capitalize(domainName.split('.')[0]),
|
||||
name: getCompanyNameFromDomainName(domainName),
|
||||
city: '',
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user