Skip to content

Commit

Permalink
👍 Enable to add images
Browse files Browse the repository at this point in the history
  • Loading branch information
azoom-k-gotou committed Aug 24, 2020
1 parent 192704a commit 8bb98ee
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 18 deletions.
9 changes: 7 additions & 2 deletions api/space-image/controllers/space-image.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
const { camelizeColumns } = require('../../../util')
'use strict';

module.exports = { ...camelizeColumns('space-image') };
/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers)
* to customize this controller
*/

module.exports = {};
14 changes: 12 additions & 2 deletions api/space-image/models/space-image.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
},
"options": {
"increments": true,
"timestamps": ["created_datetime", "updated_datetime"]
"timestamps": [
"created_datetime",
"updated_datetime"
]
},
"attributes": {
"space_id": {
Expand All @@ -19,7 +22,14 @@
"required": true
},
"image": {
"type": "string",
"model": "file",
"via": "related",
"allowedTypes": [
"files",
"images",
"videos"
],
"plugin": "upload",
"required": true
}
}
Expand Down
9 changes: 7 additions & 2 deletions api/space-layout/controllers/space-layout.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
const { camelizeColumns } = require('../../../util')
'use strict';

module.exports = { ...camelizeColumns('space-layout') };
/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers)
* to customize this controller
*/

module.exports = {};
16 changes: 13 additions & 3 deletions api/space-layout/models/space-layout.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
},
"options": {
"increments": true,
"timestamps": ["created_datetime", "updated_datetime"]
"timestamps": [
"created_datetime",
"updated_datetime"
]
},
"attributes": {
"space_id": {
Expand All @@ -22,8 +25,15 @@
"required": true
},
"image": {
"type": "string",
"required": true
"model": "file",
"via": "related",
"allowedTypes": [
"files",
"images",
"videos"
],
"plugin": "upload",
"required": false
}
}
}
21 changes: 12 additions & 9 deletions api/space/models/space.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
},
"options": {
"increments": true,
"timestamps": ["created_datetime", "updated_datetime"]
"timestamps": [
"created_datetime",
"updated_datetime"
]
},
"attributes": {
"property_id": {
Expand Down Expand Up @@ -61,14 +64,6 @@
"via": "space_id",
"collection": "spaces-cancel-policies"
},
"space_images": {
"via": "space_id",
"collection": "space-image"
},
"space_layouts": {
"via": "space_id",
"collection": "space-layout"
},
"spaces_usages": {
"via": "space_id",
"collection": "spaces-usages"
Expand All @@ -80,6 +75,14 @@
"spaces_equipment_types": {
"via": "space_id",
"collection": "spaces-equipment-types"
},
"space_layouts": {
"via": "space_id",
"collection": "space-layout"
},
"space_images": {
"via": "space_id",
"collection": "space-image"
}
}
}

0 comments on commit 8bb98ee

Please sign in to comment.