Skip to content

Commit

Permalink
Merge pull request #400 from TogetherCrew/398-implement-listener-for-…
Browse files Browse the repository at this point in the history
…engagementtokenissued-event-to-update-dynamicnft-module

chore: update validation and mongo-lib package
  • Loading branch information
Behzad-rabiei authored Nov 11, 2024
2 parents c0908d4 + 42bac26 commit 5344f70
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@discordjs/rest": "^1.7.0",
"@notionhq/client": "^2.2.3",
"@sentry/node": "^7.50.0",
"@togethercrew.dev/db": "^3.0.71",
"@togethercrew.dev/db": "^3.0.72",
"@togethercrew.dev/tc-messagebroker": "^0.0.50",
"@types/express-session": "^1.17.7",
"@types/morgan": "^1.9.5",
Expand Down
23 changes: 23 additions & 0 deletions src/validations/module.validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,22 @@ const violationDetectionOptions = () => {
});
};

const dynamicNftOptions = () => {
return Joi.object().keys({
platforms: Joi.array().items(
Joi.object()
.keys({
// name: Joi.string().default(null),
// platform: Joi.string().default(null),
metadata: Joi.object().keys({
transactionHash: Joi.string().required(),
}),
})
.required(),
),
});
};

const dynamicModuleUpdate = (req: any) => {
const moduleName = req.module?.name;
const paramsOption = {
Expand All @@ -170,6 +186,13 @@ const dynamicModuleUpdate = (req: any) => {
}),
};
break;
case ModuleNames.DynamicNft:
bodyOption = {
body: Joi.object().required().keys({
options: dynamicNftOptions(),
}),
};
break;
default:
req.allowInput = false;
return {};
Expand Down

0 comments on commit 5344f70

Please sign in to comment.