-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
73 add feature to show the most recent image (#148)
* feat(backend): ✨ create a most recent image collection type in strapi * feat(frontend): ✨ make most recent image query * feat(frontend): ✨ display most recent satellite image on homepage
- Loading branch information
Mats
authored and
GitHub
committed
Mar 18, 2024
1 parent
28332c5
commit 4dd1f88
Showing
9 changed files
with
741 additions
and
4 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
backend/src/api/most-recent-image/content-types/most-recent-image/schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "kind": "collectionType", | ||
| "collectionName": "most_recent_images", | ||
| "info": { | ||
| "singularName": "most-recent-image", | ||
| "pluralName": "most-recent-images", | ||
| "displayName": "Most Recent Image" | ||
| }, | ||
| "options": { | ||
| "draftAndPublish": true | ||
| }, | ||
| "pluginOptions": {}, | ||
| "attributes": { | ||
| "mostRecentImage": { | ||
| "allowedTypes": [ | ||
| "images", | ||
| "files", | ||
| "videos", | ||
| "audios" | ||
| ], | ||
| "type": "media", | ||
| "multiple": false, | ||
| "required": true | ||
| }, | ||
| "satellite": { | ||
| "type": "relation", | ||
| "relation": "oneToOne", | ||
| "target": "api::satellite.satellite" | ||
| } | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
backend/src/api/most-recent-image/controllers/most-recent-image.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| 'use strict'; | ||
|
|
||
| /** | ||
| * most-recent-image controller | ||
| */ | ||
|
|
||
| const { createCoreController } = require('@strapi/strapi').factories; | ||
|
|
||
| module.exports = createCoreController('api::most-recent-image.most-recent-image'); |
Oops, something went wrong.