Skip to content

Commit

Permalink
not always override (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
franzns authored Feb 29, 2024
1 parent c30fcc9 commit 05eba56
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions modules/content/github-content.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,23 @@ export class GithubContentService implements ContentService {
}
}

// only override coingecko ID if it's present
let update = {};
if (coingeckoTokenId) {
update = {
name: githubToken.name,
symbol: githubToken.symbol,
logoURI: { set: githubToken.logoURI || null },
coingeckoTokenId: coingeckoTokenId,
};
} else {
update = {
name: githubToken.name,
symbol: githubToken.symbol,
logoURI: { set: githubToken.logoURI || null },
};
}

await prisma.prismaToken.upsert({
where: {
address_chain: { address: tokenAddress, chain: networkContext.chain },
Expand All @@ -111,12 +128,7 @@ export class GithubContentService implements ContentService {
telegramUrl: null,
twitterUsername: null,
},
update: {
name: githubToken.name,
symbol: githubToken.symbol,
logoURI: { set: githubToken.logoURI || null },
coingeckoTokenId: coingeckoTokenId,
},
update: update,
});
}

Expand Down

0 comments on commit 05eba56

Please sign in to comment.