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

feat: Add new fields to create & update api's #250

Merged
merged 10 commits into from
Oct 21, 2024

Conversation

petesfrench
Copy link
Contributor

@petesfrench petesfrench commented Oct 9, 2024

Done

  • Adds the new fields detailed in the figma design to the api for creation and updating.
  • The fields are as follows (which are all strings except 'products'):
    name
    author
    asset_type
    google_drive_link
    salesforce_campaign_id
    language
    products
  • Aligned the naming for 'salesforce_campaign_id'

QA

  • Run the branch locally
  • Use the API to create a new asset, using the newly added fields
  • Use the API to update an asset, using the newly added fields
  • Use the API to fetch the asset, checking all the fields are returned

Using postman

You can create an asset with a POST request to 'http://0.0.0.0:8017/manager/create'
You can copy this into the 'bulk edit' tab within 'body'. You just need to manually add a file:

tags:tag1, tag2
asset_type:type
author_email:[email protected]
google_drive_link:glink
salesforce_campaign_id:sfid
language:lang
products:product1, product2
author_first_name:firstname
author_last_name:lastname

You can edit an asset with a POST request to http://0.0.0.0:8017/manager/update?file-path=FILE_NAME. You can use the same 'bulk edit as above and adjust some values.

To check I would just make a GET request to http://0.0.0.0:8017/v1 to list all assets, it should be the last in the list

Issue / Card

Fixes https://warthogs.atlassian.net/browse/WD-15204

@petesfrench petesfrench changed the title WIP feat: Add new fields to create & update api's feat: Add new fields to create & update api's Oct 11, 2024
@petesfrench petesfrench changed the base branch from main to feature_assets_improvement October 17, 2024 14:19
@petesfrench petesfrench requested review from immortalcodes and removed request for akbarkz October 18, 2024 06:47
products.yaml Show resolved Hide resolved
webapp/models.py Show resolved Hide resolved
webapp/services.py Show resolved Hide resolved
webapp/services.py Outdated Show resolved Hide resolved
webapp/routes.py Show resolved Hide resolved
webapp/services.py Outdated Show resolved Hide resolved
@immortalcodes
Copy link
Member

Works fine for create got this error for update

image
Made this call

image

@immortalcodes
Copy link
Member

Also are we not removing the GET method?

@petesfrench
Copy link
Contributor Author

I believe you have to pass the file-name in the url like this: http://0.0.0.0:8017/manager/update?file-path=FILE_NAME @immortalcodes

@immortalcodes
Copy link
Member

Thanks for the PR.
You have done some awesome work here. 🥳

@petesfrench petesfrench merged commit 55a5b8e into feature_assets_improvement Oct 21, 2024
5 checks passed
@petesfrench petesfrench deleted the wd-15204 branch October 21, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants