@merkl/api 0.16.17 → 0.16.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
|
|
1
1
|
import { apiDbClient } from "../../../utils/prisma";
|
2
|
+
import { UserRepository } from "../user/user.repository";
|
2
3
|
export class ComputedValueRepository {
|
3
4
|
static async findCampaignValue(params) {
|
4
5
|
return await apiDbClient.campaignComputedValue.findUnique({
|
@@ -27,6 +28,8 @@ export class ComputedValueRepository {
|
|
27
28
|
});
|
28
29
|
}
|
29
30
|
static async upsertUserComputedValues(data) {
|
31
|
+
// Make sure user foreign keys exist
|
32
|
+
await UserRepository.createMany(data.map(item => ({ address: item.address, tags: [] })));
|
30
33
|
await apiDbClient.$transaction(data.map(item => {
|
31
34
|
return apiDbClient.userComputedValue.upsert({
|
32
35
|
where: {
|