-
Notifications
You must be signed in to change notification settings - Fork 3
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
Tweak logic for register new deployment #230
Conversation
✅ Deploy Preview for ami-storybook canceled.
|
✅ Deploy Preview for ami-web canceled.
|
It works! I believe the only thing missing is the project assignment. When you create a deployment it "disappears" because it is not assigned to a project. Can you pass the current project ID to the POST request when creating a Deployment? (the property is just called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works! I believe the only thing missing is the project assignment. When you create a deployment it "disappears" because it is not assigned to a project. Can you pass the current project ID to the POST request when creating a Deployment? (the property is just called project and accepts a project ID). You can test that in the API test page as well: https://api.dev.insectai.org/api/v2/deployments/
Ah yes, sorry, forgot about that. Code is updated! I believe the project param expects a full url, would it be possible to just pass the id here? |
@@ -14,7 +13,7 @@ const convertToServerFieldValues = (fieldValues: DeploymentFieldValues) => ({ | |||
latitude: fieldValues.latitude, | |||
longitude: fieldValues.longitude, | |||
occurrences: [], | |||
project: null, | |||
project: `http://api.dev.insectai.org/api/v2/projects/${fieldValues.projectId}/`, // TODO: Can we pass just id here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting 400 if I just pass the id here @mihow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Just pushed a FE fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works!
Show "Register new deployment" if logged in user has create permissions.