Merge pull request #1484 from omnivore-app/add-savedAt-to-update-api

Update savedAt in update page api
This commit is contained in:
Hongbo Wu 2022-12-01 09:41:09 +08:00 committed by GitHub
commit 26b2bd515a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 2 deletions

View file

@ -2392,6 +2392,7 @@ export type UpdatePageInput = {
byline?: InputMaybe<Scalars['String']>;
description?: InputMaybe<Scalars['String']>;
pageId: Scalars['ID'];
savedAt?: InputMaybe<Scalars['Date']>;
title?: InputMaybe<Scalars['String']>;
};

View file

@ -1836,6 +1836,7 @@ input UpdatePageInput {
byline: String
description: String
pageId: ID!
savedAt: Date
title: String
}

View file

@ -37,9 +37,10 @@ export const updatePageResolver = authorized<
const pageData = {
id: input.pageId,
title: input.title || undefined,
description: input.description || '',
title: input.title ?? undefined,
description: input.description ?? undefined,
author: input.byline ?? undefined,
savedAt: input.savedAt ? new Date(input.savedAt) : undefined,
}
const updateResult = await updatePage(input.pageId, pageData, { ...ctx, uid })

View file

@ -531,6 +531,7 @@ const schema = gql`
title: String
description: String
byline: String
savedAt: Date
}
type UpdatePageSuccess {