Skip to content

Conversation

@Fiyin-Anne
Copy link
Contributor

@Fiyin-Anne Fiyin-Anne commented Sep 18, 2020

What does this PR do

This PR creates a route for admin to add a new country to the database.

Description of tasks to be completed?

  • verify that the user is an admin
  • create a route for admin to add a new country

How should this be manually tested/checked?

  1. Clone the PR
  2. Cd into the branch ft-admin-can-add-country-174879639
  3. Install the dependencies using npm install
  4. Set up database connection string as shown in the .env.sample file.
  5. Run npm run migrate to create the database tables
  6. Run npm run seed to feed the database
  7. Start the server by running npm run start-dev
  8. Sign in via http://localhost:3000/api/v1/users/signin using a POST method with
          {
          "email: "ufuoma@gmail.com",
          "password": 12345
           }

and copy the token (without the quotes) from the response body.
9. In a new tab, under the Authorization tab, change the TYPE to Bearer Token and paste the token in the space available. Make a POST request to http://localhost:3000/api/v1/admin/country to add a country

       {
          "nameOfCountry": "togo",
        "gallery":
            "https://image.shutterstock.com/image-illustration/togo-flag-silk-260nw-419363206.jpg",
        "capital": "Lome",
        "population": 205,
        "officialLanguage": "English",
        "region": "West Africa",
        "currency": "CFA franc"
          }

What are the relevant pivotal tracker stories?

#174879639

Architectural Flowchart

Flowchart: Admin can add country

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

The configured eslint version is not supported.
The configured eslint version is not supported. 
See a list of supported versions on our docs page.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

The configured eslint version is not supported.
The configured eslint version is not supported. 
See a list of supported versions on our docs page.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

The configured eslint version is not supported.
The configured eslint version is not supported. 
See a list of supported versions on our docs page.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

The configured eslint version is not supported.
The configured eslint version is not supported. 
See a list of supported versions on our docs page.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

The configured eslint version is not supported.
The configured eslint version is not supported. 
See a list of supported versions on our docs page.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

The configured eslint version is not supported.
The configured eslint version is not supported. 
See a list of supported versions on our docs page.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

The configured eslint version is not supported.
The configured eslint version is not supported. 
See a list of supported versions on our docs page.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

The configured eslint version is not supported.
The configured eslint version is not supported. 
See a list of supported versions on our docs page.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

The configured eslint version is not supported.
The configured eslint version is not supported. 
See a list of supported versions on our docs page.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Oops! Something went wrong! :(
ESLint: 5.7.0.
ESLint couldn't find the plugin "eslint-plugin-jsdoc". This can happen for a couple different reasons:
1. If ESLint is installed globally, then make sure eslint-plugin-jsdoc is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.
2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
    npm i eslint-plugin-jsdoc@latest --save-dev
Path to ESLint package: /home/linters/app/versions/eslint-5.7.0/node_modules/eslint
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Oops! Something went wrong! :(
ESLint: 5.7.0.
ESLint couldn't find the plugin "eslint-plugin-jsdoc". This can happen for a couple different reasons:
1. If ESLint is installed globally, then make sure eslint-plugin-jsdoc is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.
2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
    npm i eslint-plugin-jsdoc@latest --save-dev
Path to ESLint package: /home/linters/app/versions/eslint-5.7.0/node_modules/eslint
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Oops! Something went wrong! :(
ESLint: 5.7.0.
ESLint couldn't find the plugin "eslint-plugin-jsdoc". This can happen for a couple different reasons:
1. If ESLint is installed globally, then make sure eslint-plugin-jsdoc is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.
2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
    npm i eslint-plugin-jsdoc@latest --save-dev
Path to ESLint package: /home/linters/app/versions/eslint-5.7.0/node_modules/eslint
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Oops! Something went wrong! :(
ESLint: 5.7.0.
ESLint couldn't find the plugin "eslint-plugin-jsdoc". This can happen for a couple different reasons:
1. If ESLint is installed globally, then make sure eslint-plugin-jsdoc is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.
2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
    npm i eslint-plugin-jsdoc@latest --save-dev
Path to ESLint package: /home/linters/app/versions/eslint-5.7.0/node_modules/eslint
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

Copy link

@hound hound bot left a comment

Choose a reason for hiding this comment

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

Some files could not be reviewed due to errors:

Oops! Something went wrong! :(
ESLint: 5.7.0.
ESLint couldn't find the plugin "eslint-plugin-jsdoc". This can happen for a couple different reasons:
1. If ESLint is installed globally, then make sure eslint-plugin-jsdoc is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.
2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
    npm i eslint-plugin-jsdoc@latest --save-dev
Path to ESLint package: /home/linters/app/versions/eslint-5.7.0/node_modules/eslint
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

@donaldcrane donaldcrane self-requested a review October 25, 2020 23:05
@feobaby feobaby merged commit 1da2ac4 into develop Oct 26, 2020
@feobaby feobaby deleted the ft-admin-can-add-country-174879639 branch October 26, 2020 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest Hacktoberfest is a month-long celebration of open source software work-in-progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants