Skip to content

Commit

Permalink
fix(backend): 🐛 connect article slug to previewTitle. change name to …
Browse files Browse the repository at this point in the history
…previewTitle (#280)
  • Loading branch information
Mats authored and GitHub committed Apr 13, 2024
1 parent 478fec9 commit a5fac10
Show file tree
Hide file tree
Showing 6 changed files with 228 additions and 18 deletions.
5 changes: 3 additions & 2 deletions backend/src/api/article/content-types/article/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
},
"pluginOptions": {},
"attributes": {
"previewCardTitle": {
"previewTitle": {
"type": "string",
"required": true,
"unique": true
},
"slug": {
"type": "uid",
"required": true
"required": true,
"targetField": "previewTitle"
},
"datePublished": {
"type": "date",
Expand Down
209 changes: 207 additions & 2 deletions backend/types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,205 @@ export interface AdminTransferTokenPermission extends Schema.CollectionType {
};
}

export interface ApiArticleArticle extends Schema.CollectionType {
collectionName: 'articles';
info: {
singularName: 'article';
pluralName: 'articles';
displayName: 'Article';
description: '';
};
options: {
draftAndPublish: true;
};
attributes: {
previewTitle: Attribute.String & Attribute.Required & Attribute.Unique;
slug: Attribute.UID<'api::article.article', 'previewTitle'> &
Attribute.Required;
datePublished: Attribute.Date & Attribute.Required;
coverImage: Attribute.Media;
body: Attribute.Blocks & Attribute.Required;
author: Attribute.Relation<
'api::article.article',
'manyToOne',
'api::author.author'
>;
Tag: Attribute.Enumeration<['Featured', 'News', 'Updates']>;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
'api::article.article',
'oneToOne',
'admin::user'
> &
Attribute.Private;
updatedBy: Attribute.Relation<
'api::article.article',
'oneToOne',
'admin::user'
> &
Attribute.Private;
};
}

export interface ApiAuthorAuthor extends Schema.CollectionType {
collectionName: 'authors';
info: {
singularName: 'author';
pluralName: 'authors';
displayName: 'Author';
};
options: {
draftAndPublish: true;
};
attributes: {
name: Attribute.String & Attribute.Required;
avatar: Attribute.Media;
articles: Attribute.Relation<
'api::author.author',
'oneToMany',
'api::article.article'
>;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
'api::author.author',
'oneToOne',
'admin::user'
> &
Attribute.Private;
updatedBy: Attribute.Relation<
'api::author.author',
'oneToOne',
'admin::user'
> &
Attribute.Private;
};
}

export interface ApiMostRecentImageMostRecentImage
extends Schema.CollectionType {
collectionName: 'most_recent_images';
info: {
singularName: 'most-recent-image';
pluralName: 'most-recent-images';
displayName: 'Most Recent Image';
};
options: {
draftAndPublish: true;
};
attributes: {
mostRecentImage: Attribute.Media & Attribute.Required;
satellite: Attribute.Relation<
'api::most-recent-image.most-recent-image',
'manyToOne',
'api::satellite.satellite'
>;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
'api::most-recent-image.most-recent-image',
'oneToOne',
'admin::user'
> &
Attribute.Private;
updatedBy: Attribute.Relation<
'api::most-recent-image.most-recent-image',
'oneToOne',
'admin::user'
> &
Attribute.Private;
};
}

export interface ApiProjectProject extends Schema.CollectionType {
collectionName: 'projects';
info: {
singularName: 'project';
pluralName: 'projects';
displayName: 'Project';
description: '';
};
options: {
draftAndPublish: true;
};
attributes: {
title: Attribute.String & Attribute.Required & Attribute.Unique;
content: Attribute.Blocks;
slug: Attribute.UID<'api::project.project', 'title'> & Attribute.Required;
previewImage: Attribute.Media;
satellites: Attribute.Relation<
'api::project.project',
'manyToMany',
'api::satellite.satellite'
>;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
'api::project.project',
'oneToOne',
'admin::user'
> &
Attribute.Private;
updatedBy: Attribute.Relation<
'api::project.project',
'oneToOne',
'admin::user'
> &
Attribute.Private;
};
}

export interface ApiSatelliteSatellite extends Schema.CollectionType {
collectionName: 'satellites';
info: {
singularName: 'satellite';
pluralName: 'satellites';
displayName: 'Satellite';
description: '';
};
options: {
draftAndPublish: true;
};
attributes: {
name: Attribute.String & Attribute.Required & Attribute.Unique;
celestrakURL: Attribute.String & Attribute.Unique;
catalogNumberNORAD: Attribute.String & Attribute.Unique;
content: Attribute.Blocks;
previewImage: Attribute.Media;
projects: Attribute.Relation<
'api::satellite.satellite',
'manyToMany',
'api::project.project'
>;
most_recent_images: Attribute.Relation<
'api::satellite.satellite',
'oneToMany',
'api::most-recent-image.most-recent-image'
>;
missionStatus: Attribute.String;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
'api::satellite.satellite',
'oneToOne',
'admin::user'
> &
Attribute.Private;
updatedBy: Attribute.Relation<
'api::satellite.satellite',
'oneToOne',
'admin::user'
> &
Attribute.Private;
};
}

export interface PluginUploadFile extends Schema.CollectionType {
collectionName: 'files';
info: {
Expand Down Expand Up @@ -800,8 +999,9 @@ export interface ApiArticleArticle extends Schema.CollectionType {
draftAndPublish: true;
};
attributes: {
previewCardTitle: Attribute.String & Attribute.Required & Attribute.Unique;
slug: Attribute.UID & Attribute.Required;
previewTitle: Attribute.String & Attribute.Required & Attribute.Unique;
slug: Attribute.UID<'api::article.article', 'previewTitle'> &
Attribute.Required;
datePublished: Attribute.Date & Attribute.Required;
coverImage: Attribute.Media;
body: Attribute.Blocks & Attribute.Required;
Expand Down Expand Up @@ -1022,6 +1222,11 @@ declare module '@strapi/types' {
'admin::api-token-permission': AdminApiTokenPermission;
'admin::transfer-token': AdminTransferToken;
'admin::transfer-token-permission': AdminTransferTokenPermission;
'api::article.article': ApiArticleArticle;
'api::author.author': ApiAuthorAuthor;
'api::most-recent-image.most-recent-image': ApiMostRecentImageMostRecentImage;
'api::project.project': ApiProjectProject;
'api::satellite.satellite': ApiSatelliteSatellite;
'plugin::upload.file': PluginUploadFile;
'plugin::upload.folder': PluginUploadFolder;
'plugin::content-releases.release': PluginContentReleasesRelease;
Expand Down
Loading

0 comments on commit a5fac10

Please sign in to comment.