Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add custom_api directory with create and update #272

Merged
merged 7 commits into from
Sep 29, 2024

Conversation

GideonBature
Copy link
Contributor

completed the task by adding the custom_api directory and setting up the POST and PUT method for it. Also, added the api_url and regex fields to the QuestTaskDocument in the models.rs file. Also made changes to all the files using the QuestTaskDocument to include the api_url and the regex fields, setting their values as None, since they are not needed in those other context, at least in this scope. I also did this to remove likely errors that might emanate from those files due to the changes I made to the QuestTaskDocument model in the models.rs file.

Copy link
Collaborator

@Marchand-Nicolas Marchand-Nicolas left a comment

Choose a reason for hiding this comment

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

Missing pub mod custom_api in src\endpoints\admin\mod.rs.

Comment on lines 54 to 59
// Build a vector of FieldElement from the comma separated contracts string
let parsed_contracts: Vec<FieldElement> = body
.contracts
.split(",")
.map(|x| FieldElement::from_str(&x).unwrap())
.collect();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This part is unused

@Marchand-Nicolas Marchand-Nicolas added the ❌ Change request Change requested from reviewer label Sep 28, 2024
Copy link
Collaborator

@Marchand-Nicolas Marchand-Nicolas left a comment

Choose a reason for hiding this comment

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

Very little change!

@@ -17,3 +17,4 @@ pub mod leaderboard;
pub mod quest_boost;
pub mod quests;
pub mod unique_page_visit;
pub mod custom_api;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not the right mod. There i a mod.rs in each folder. This is to indicate rust all the dependency tree. Every time, when adding a folder or a file, we need to update the mod.rs that is in the same directory. In your case, you added your folder in src\endpoints\admin, so you have to update src\endpoints\admin\mod.rs

Comment on lines +1 to +2
pub mod create_custom_api;
pub mod update_custom_api;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here this mod.rs is setup perfectly

@Marchand-Nicolas
Copy link
Collaborator

Also, I suggest you to try installing cargo so that you can try compiling or running the project, because all these issues are compiling issues, not even runtime issues

@GideonBature
Copy link
Contributor Author

Noted, sorry, an oversight from my own end, Thank you ser.

Copy link
Collaborator

@Marchand-Nicolas Marchand-Nicolas left a comment

Choose a reason for hiding this comment

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

Working really well! Lgtm

@Marchand-Nicolas Marchand-Nicolas merged commit b107770 into lfglabs-dev:testnet Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❌ Change request Change requested from reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants