Skip to content

Commit

Permalink
Merge pull request #545 from bluewave-labs/533-create-the-backend-for…
Browse files Browse the repository at this point in the history
…-tours

533 create the backend for tours
  • Loading branch information
DeboraSerra authored Feb 18, 2025
2 parents 4b2dd50 + a556fc1 commit 18c9d81
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/migrations/0013-1.1-tour-popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ module.exports = {
type: Sequelize.STRING(255),
allowNull: false,
},
header: {
type: Sequelize.STRING(255),
allowNull: false,
},
description: {
type: Sequelize.TEXT,
allowNull: false,
Expand Down
4 changes: 4 additions & 0 deletions backend/src/models/TourPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ module.exports = (sequelize, DataTypes) => {
type: DataTypes.STRING,
allowNull: false,
},
header: {
type: DataTypes.STRING,
allowNull: false,
},
description: {
type: DataTypes.TEXT,
allowNull: false,
Expand Down
1 change: 1 addition & 0 deletions backend/src/test/mocks/tour.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ class TourPopupBuilder {
this.tourPopup = {
id: id,
title: `title ${id}`,
header: `header ${id}`,
description: `description ${id}`,
targetElement: `.element${id}`,
order: id,
Expand Down
1 change: 1 addition & 0 deletions backend/src/utils/tour.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const tourValidator = [
body('active').optional().isBoolean().withMessage('Invalid value for active'),
body('steps').isArray().withMessage('steps must be an array'),
body('steps.*.title').isString().withMessage('Invalid value for title'),
body('steps.*.header').isString().withMessage('Invalid value for header'),
body('steps.*.description').isString().withMessage('Invalid value for description'),
body('steps.*.targetElement').isString().withMessage('Invalid value for targetElement'),
body('steps.*.order').isInt().withMessage('Invalid value for order'),
Expand Down

0 comments on commit 18c9d81

Please sign in to comment.