mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Merge pull request #802 from omnivore-app/add-readat-to-article
Add readAt to article
This commit is contained in:
commit
6f4c408b5c
5 changed files with 8 additions and 0 deletions
|
|
@ -224,6 +224,7 @@ export interface SearchItem {
|
|||
userId: string
|
||||
state?: ArticleSavingRequestStatus
|
||||
language?: string
|
||||
readAt?: Date
|
||||
}
|
||||
|
||||
const keys = ['_id', 'url', 'slug', 'userId', 'uploadFileId', 'state'] as const
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ export type Article = {
|
|||
pageType?: Maybe<PageType>;
|
||||
postedByViewer?: Maybe<Scalars['Boolean']>;
|
||||
publishedAt?: Maybe<Scalars['Date']>;
|
||||
readAt?: Maybe<Scalars['Date']>;
|
||||
readingProgressAnchorIndex: Scalars['Int'];
|
||||
readingProgressPercent: Scalars['Float'];
|
||||
savedAt: Scalars['Date'];
|
||||
|
|
@ -3070,6 +3071,7 @@ export type ArticleResolvers<ContextType = ResolverContext, ParentType extends R
|
|||
pageType?: Resolver<Maybe<ResolversTypes['PageType']>, ParentType, ContextType>;
|
||||
postedByViewer?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
|
||||
publishedAt?: Resolver<Maybe<ResolversTypes['Date']>, ParentType, ContextType>;
|
||||
readAt?: Resolver<Maybe<ResolversTypes['Date']>, ParentType, ContextType>;
|
||||
readingProgressAnchorIndex?: Resolver<ResolversTypes['Int'], ParentType, ContextType>;
|
||||
readingProgressPercent?: Resolver<ResolversTypes['Float'], ParentType, ContextType>;
|
||||
savedAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>;
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ type Article {
|
|||
pageType: PageType
|
||||
postedByViewer: Boolean
|
||||
publishedAt: Date
|
||||
readAt: Date
|
||||
readingProgressAnchorIndex: Int!
|
||||
readingProgressPercent: Float!
|
||||
savedAt: Date!
|
||||
|
|
|
|||
|
|
@ -351,6 +351,7 @@ const schema = gql`
|
|||
unsubHttpUrl: String
|
||||
state: ArticleSavingRequestStatus
|
||||
language: String
|
||||
readAt: Date
|
||||
}
|
||||
|
||||
# Query: article
|
||||
|
|
|
|||
|
|
@ -302,6 +302,7 @@ const saveArticleReadingProgressQuery = (
|
|||
updatedArticle {
|
||||
id
|
||||
readingProgressPercent
|
||||
readAt
|
||||
}
|
||||
}
|
||||
... on SaveArticleReadingProgressError {
|
||||
|
|
@ -845,6 +846,8 @@ describe('Article API', () => {
|
|||
res.body.data.saveArticleReadingProgress.updatedArticle
|
||||
.readingProgressPercent
|
||||
).to.eq(progress)
|
||||
expect(res.body.data.saveArticleReadingProgress.updatedArticle.readAt)
|
||||
.not.null
|
||||
})
|
||||
|
||||
it('should not allow setting the reading progress lower than current progress', async () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue