Skip to content

Commit

Permalink
fix: update prisma
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsoffer committed Sep 22, 2022
1 parent ab394bd commit a5b8fc3
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 30 deletions.
5 changes: 0 additions & 5 deletions lib/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ export const event = ({ action, params }) => {
};

export const getSubgraph = (network) => {
// if network is mainnet use decentralized network
if (network === "mainnet") {
return `https://gateway.thegraph.com/api/643e75af14ebedf13430c47ee045f07a/subgraphs/id/5WHJhK3TW4zAc3d3KaNXwmPjRAyRqibTqzFhiRrWVWWg`;
}

return `https://api.thegraph.com/subgraphs/name/web3index/${network}`;
};

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@modulz/design-system": "^0.6.2",
"@modulz/radix-icons": "^4.0.0",
"@next/mdx": "^10.2.0",
"@prisma/client": "^2.22.1",
"@prisma/client": "3.15.2",
"@radix-ui/colors": "^0.1.7",
"@radix-ui/react-accordion": "^0.0.13",
"@radix-ui/react-icons": "^1.0.3",
Expand Down Expand Up @@ -79,7 +79,7 @@
"husky": "^4.2.5",
"lint-staged": "^10.5.4",
"prettier": "^2.2.1",
"prisma": "^2.22.1",
"prisma": "3.15.2",
"typescript": "^4.2.3"
},
"husky": {
Expand Down
10 changes: 5 additions & 5 deletions pages/api/projects/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const getUsageFromDB = async (name) => {
where: {
projectId: project.id,
},
sum: {
_sum: {
revenue: true,
},
});
Expand All @@ -53,7 +53,7 @@ const getUsageFromDB = async (name) => {
});

const revenue = {
now: now.sum.revenue, // total revenue as of now
now: now._sum.revenue, // total revenue as of now
oneDayAgo: await getRevenueFromDB(project.id, utcOneDayBack, prisma), // total revenue as of 1 day ago
twoDaysAgo: await getRevenueFromDB(project.id, utcTwoDaysBack, prisma), // total revenue as of two days ago
oneWeekAgo: await getRevenueFromDB(project.id, utcOneWeekBack, prisma), // total revenue as of one week ago
Expand Down Expand Up @@ -87,16 +87,16 @@ const getRevenueFromDB = async (projectId, date, prisma) => {
lte: date,
},
},
sum: {
_sum: {
revenue: true,
},
});

if (rev.sum.revenue == null) {
if (rev._sum.revenue == null) {
return 0;
}

return rev.sum.revenue;
return rev._sum.revenue;
};

const getUsageFromSubgraph = async (id, networks) => {
Expand Down
36 changes: 18 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1586,22 +1586,22 @@
resolved "https://registry.yarnpkg.com/@opentelemetry/context-base/-/context-base-0.14.0.tgz#c67fc20a4d891447ca1a855d7d70fa79a3533001"
integrity sha512-sDOAZcYwynHFTbLo6n8kIbLiVF3a3BLkrmehJUyEbT9F+Smbi47kLGS2gG2g0fjBLR/Lr1InPD7kXL7FaTqEkw==

"@prisma/client@^2.22.1":
version "2.30.3"
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-2.30.3.tgz#49c1015e2cec26a44b20c62eb2fd738cb0bb043b"
integrity sha512-Ey2miZ+Hne12We3rA8XrlPoAF0iuKEhw5IK2nropaelSt0Ju3b2qSz9Qt50a/1Mx3+7yRSu/iSXt8y9TUMl/Yw==
"@prisma/client@3.15.2":
version "3.15.2"
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-3.15.2.tgz#2181398147afc79bfe0d83c03a88dc45b49bd365"
integrity sha512-ErqtwhX12ubPhU4d++30uFY/rPcyvjk+mdifaZO5SeM21zS3t4jQrscy8+6IyB0GIYshl5ldTq6JSBo1d63i8w==
dependencies:
"@prisma/engines-version" "2.30.1-2.b8c35d44de987a9691890b3ddf3e2e7effb9bf20"
"@prisma/engines-version" "3.15.1-1.461d6a05159055555eb7dfb337c9fb271cbd4d7e"

"@prisma/engines-version@2.30.1-2.b8c35d44de987a9691890b3ddf3e2e7effb9bf20":
version "2.30.1-2.b8c35d44de987a9691890b3ddf3e2e7effb9bf20"
resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-2.30.1-2.b8c35d44de987a9691890b3ddf3e2e7effb9bf20.tgz#d5ef55c92beeba56e52bba12b703af0bfd30530d"
integrity sha512-/iDRgaoSQC77WN2oDsOM8dn61fykm6tnZUAClY+6p+XJbOEgZ9gy4CKuKTBgrjSGDVjtQ/S2KGcYd3Ring8xaw==
"@prisma/engines-version@3.15.1-1.461d6a05159055555eb7dfb337c9fb271cbd4d7e":
version "3.15.1-1.461d6a05159055555eb7dfb337c9fb271cbd4d7e"
resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-3.15.1-1.461d6a05159055555eb7dfb337c9fb271cbd4d7e.tgz#bf5e2373ca68ce7556b967cb4965a7095e93fe53"
integrity sha512-e3k2Vd606efd1ZYy2NQKkT4C/pn31nehyLhVug6To/q8JT8FpiMrDy7zmm3KLF0L98NOQQcutaVtAPhzKhzn9w==

"@prisma/engines@2.30.1-2.b8c35d44de987a9691890b3ddf3e2e7effb9bf20":
version "2.30.1-2.b8c35d44de987a9691890b3ddf3e2e7effb9bf20"
resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-2.30.1-2.b8c35d44de987a9691890b3ddf3e2e7effb9bf20.tgz#2df768aa7c9f84acaa1f35c970417822233a9fb1"
integrity sha512-WPnA/IUrxDihrRhdP6+8KAVSwsc0zsh8ioPYsLJjOhzVhwpRbuFH2tJDRIAbc+qFh+BbTIZbeyBYt8fpNXaYQQ==
"@prisma/engines@3.15.1-1.461d6a05159055555eb7dfb337c9fb271cbd4d7e":
version "3.15.1-1.461d6a05159055555eb7dfb337c9fb271cbd4d7e"
resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-3.15.1-1.461d6a05159055555eb7dfb337c9fb271cbd4d7e.tgz#f691893df506b93e3cb1ccc15ec6e5ac64e8e570"
integrity sha512-NHlojO1DFTsSi3FtEleL9QWXeSF/UjhCW0fgpi7bumnNZ4wj/eQ+BJJ5n2pgoOliTOGv9nX2qXvmHap7rJMNmg==

"@radix-ui/[email protected]", "@radix-ui/colors@^0.1.7":
version "0.1.7"
Expand Down Expand Up @@ -6873,12 +6873,12 @@ prettier@^2.2.0, prettier@^2.2.1:
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.0.tgz#a6370e2d4594e093270419d9cc47f7670488f893"
integrity sha512-FM/zAKgWTxj40rH03VxzIPdXmj39SwSjwG0heUcNFwI+EMZJnY93yAiKXM3dObIKAM5TA88werc8T/EwhB45eg==

prisma@^2.22.1:
version "2.30.3"
resolved "https://registry.yarnpkg.com/prisma/-/prisma-2.30.3.tgz#e4a770e1f52151e72c1c5be0aa2e75222a0135c4"
integrity sha512-48qYba2BIyUmXuosBZs0g3kYGrxKvo4VkSHYOuLlDdDirmKyvoY2hCYMUYHSx3f++8ovfgs+MX5KmNlP+iAZrQ==
prisma@3.15.2:
version "3.15.2"
resolved "https://registry.yarnpkg.com/prisma/-/prisma-3.15.2.tgz#4ebe32fb284da3ac60c49fbc16c75e56ecf32067"
integrity sha512-nMNSMZvtwrvoEQ/mui8L/aiCLZRCj5t6L3yujKpcDhIPk7garp8tL4nMx2+oYsN0FWBacevJhazfXAbV1kfBzA==
dependencies:
"@prisma/engines" "2.30.1-2.b8c35d44de987a9691890b3ddf3e2e7effb9bf20"
"@prisma/engines" "3.15.1-1.461d6a05159055555eb7dfb337c9fb271cbd4d7e"

process-nextick-args@~2.0.0:
version "2.0.1"
Expand Down

1 comment on commit a5b8fc3

@vercel
Copy link

@vercel vercel bot commented on a5b8fc3 Sep 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.