Created
June 17, 2024 19:55
-
-
Save bacoords/2c8d26412e7a905d5571affcc1b92dec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<pre><code class="language-typescript"> | |
import { faker } from "@faker-js/faker"; | |
const attachmentBlueprint = async (data?: Partial<Attachment>) => { | |
const messageId = data?.messageId ?? (await messageBlueprint()).id; | |
return await prisma.attachment.create({ | |
data: { | |
messageId, | |
filename: faker.system.fileName(), | |
...data | |
} | |
}); | |
} | |
</code></pre> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment