MLH-Fellowship / orientation-project-python-23.SUM.A

Orientation Project (Python) for 23.SUM.A
1 stars 12 forks source link

Implement API route to add new "Experience" #22

Closed wrussell1999 closed 1 year ago

wrussell1999 commented 1 year ago

On the /resume/experience route, you should:

viktoriussuwandi commented 1 year ago

Hi wrussell1999, do you have any other variable names as inputs, or just follow the experience class's attributes names ? I will try to help

class experience

wrussell1999 commented 1 year ago

Hey @viktoriussuwandi! Thanks for reaching out! All these attributes are the ones you should be using as inputs. We won't be adding anymore during the project so you can go off these as the final ones. Let me know if you have any questions!

viktoriussuwandi commented 1 year ago

Hi wrussell1999, sorry for late submission. I have tried to solve this issue, but always get failure on testing. If you don't mind, do you have advice on my code below ? just wanna make sure before create the PR

     if request.method == 'POST':
        data_post = request.args
        new_experience = Experience(
            data_post["title"],
            data_post["company"],
            data_post["start_date"],
            data_post["end_date"],
            data_post["description"],
            data_post["logo"]
        )
        data["experience"].append(new_experience)
        all_experience_data = data["experience"]
        resp = all_experience_data.index(new_experience)
        return jsonify({resp})

This is screenshot of the test :

Screenshot 2023-06-01 at 22 20 14
wrussell1999 commented 1 year ago

Looks like this has been raised as a PR already here: https://github.com/MLH-Fellowship/orientation-project-python-23.SUM.A/pull/24

viktoriussuwandi commented 1 year ago

Well, nice to hear that, this issue solved & closed then