diff --git a/client/src/Resources/ResourceForm.js b/client/src/Resources/ResourceForm.js index 8da6ae6..fc240c1 100644 --- a/client/src/Resources/ResourceForm.js +++ b/client/src/Resources/ResourceForm.js @@ -26,6 +26,9 @@ function ResourceForm() { email: '', website: '', logo: '', + city: '', + state: '', + zip: '', description: '', }); const [isUploading, setUploading] = useState(false); @@ -177,6 +180,42 @@ function ResourceForm() { /> {error?.errorMessagesHTMLFor?.('address')} +
{resource.contactperson}
{resource.address}
+{resource.city}
+{resource.state}
+{resource.zip}
{resource.phone}
{resource.email}
{resource.website}
diff --git a/migrations/20210819000753-create-city-state-zip.js b/migrations/20210819000753-create-city-state-zip.js new file mode 100644 index 0000000..2f0c2f4 --- /dev/null +++ b/migrations/20210819000753-create-city-state-zip.js @@ -0,0 +1,27 @@ +'use strict'; + +module.exports = { + up: async (queryInterface, Sequelize) => { + /** + * Add altering commands here. + * + * Example: + * await queryInterface.createTable('users', { id: Sequelize.INTEGER }); + */ + await queryInterface.addColumn('Resources', 'city', { type: Sequelize.STRING }); + await queryInterface.addColumn('Resources', 'state', { type: Sequelize.STRING }); + await queryInterface.addColumn('Resources', 'zip', { type: Sequelize.STRING }); + }, + + down: async (queryInterface, Sequelize) => { + /** + * Add reverting commands here. + * + * Example: + * await queryInterface.dropTable('users'); + */ + await queryInterface.removeColumn('Resources', 'city'); + await queryInterface.removeColumn('Resources', 'state'); + await queryInterface.removeColumn('Resources', 'zip'); + }, +}; diff --git a/models/resource.js b/models/resource.js index 662f361..15fbdaa 100644 --- a/models/resource.js +++ b/models/resource.js @@ -30,6 +30,9 @@ module.exports = (sequelize, DataTypes) => { email: DataTypes.STRING, website: DataTypes.STRING, address: DataTypes.TEXT, + city: DataTypes.STRING, + state: DataTypes.STRING, + zip: DataTypes.STRING, description: DataTypes.TEXT, }, { diff --git a/routes/api/resources.js b/routes/api/resources.js index e0f66bf..acbc93a 100644 --- a/routes/api/resources.js +++ b/routes/api/resources.js @@ -39,6 +39,9 @@ router.post('/', interceptors.requireLogin, async (req, res) => { 'email', 'website', 'CategoryId', + 'city', + 'state', + 'zip', 'description', ]) ); @@ -80,6 +83,9 @@ router.patch('/:id', interceptors.requireLogin, async (req, res) => { 'email', 'website', 'CategoryId', + 'city', + 'state', + 'zip', 'description', ]) );