-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into search-page-alerts
Signed-off-by: Joe Karow <[email protected]>
- Loading branch information
Showing
55 changed files
with
1,498 additions
and
1,808 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
import { addSingleKey } from '@weareinreach/crowdin/api' | ||
import { getAuditedClient } from '@weareinreach/db' | ||
import { type TRPCHandlerParams } from '~api/types/handler' | ||
|
||
import { type TCreateSchema } from './mutation.create.schema' | ||
|
||
const create = async ({ ctx, input }: TRPCHandlerParams<TCreateSchema, 'protected'>) => { | ||
const prisma = getAuditedClient(ctx.actorId) | ||
const newEmail = await prisma.orgEmail.create({ | ||
data: input, | ||
select: { id: true }, | ||
|
||
const result = await prisma.$transaction(async (tx) => { | ||
if (input.description) { | ||
const crowdinId = await addSingleKey({ | ||
isDatabaseString: true, | ||
key: input.description.create.tsKey.create.key, | ||
text: input.description.create.tsKey.create.text, | ||
}) | ||
input.description.create.tsKey.create.crowdinId = crowdinId.id | ||
} | ||
const newEmail = await tx.orgEmail.create({ | ||
data: input, | ||
select: { id: true }, | ||
}) | ||
return newEmail | ||
}) | ||
return newEmail | ||
return result | ||
} | ||
export default create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.