get rid of onboarding requirements

This commit is contained in:
m5r
2021-10-16 00:24:28 +02:00
parent c8f707af9c
commit 3cc6f35071
33 changed files with 291 additions and 142 deletions

View File

@ -22,12 +22,11 @@ export default resolver.pipe(
where: { id: organizationId },
include: { phoneNumbers: true },
});
if (!organization) {
if (!organization || !organization.phoneNumbers[0]) {
throw new NotFoundError();
}
const phoneNumberId = organization.phoneNumbers[0]!.id;
const phoneNumberId = organization.phoneNumbers[0].id;
const processingState = await db.processingPhoneNumber.findFirst({ where: { organizationId, phoneNumberId } });
if (processingState && !processingState.hasFetchedMessages) {
return;