Skip to content

Commit

Permalink
feat: update insert type
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Smith committed Mar 1, 2024
1 parent 106337b commit 840aa6a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions appsync.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ export type MutationInsertJoinRequestArgs = {
localAuthority: Scalars['String']['input'];
name: Scalars['String']['input'];
phone?: InputMaybe<Scalars['String']['input']>;
requestTime: Scalars['Float']['input'];
school?: InputMaybe<Scalars['String']['input']>;
status: Scalars['String']['input'];
type: Scalars['String']['input'];
};

Expand Down
2 changes: 0 additions & 2 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ type Mutation {
name: String!
localAuthority: String!
type: String!
requestTime: Float!
status: String!
email: String!
school: String
jobTitle: String
Expand Down
5 changes: 3 additions & 2 deletions src/handlers/privateResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const handler: AppSyncResolverHandler<
| MutationUpdateSchoolProfileArgs
| MutationUpdateJoinRequestArgs
| MutationInsertItemQueryArgs
| MutationInsertJoinRequestArgs
| MutationInsertLocalAuthorityRegisterRequestArgs,
boolean
> = async (event, context, callback) => {
Expand Down Expand Up @@ -81,10 +82,10 @@ export const handler: AppSyncResolverHandler<
const status = 'NEW';
const requestTime = Number(new Date());
const res = await joinRequestsRepository.insert({
...params,
...(params as MutationInsertJoinRequestArgs),
status,
requestTime,
} as MutationInsertJoinRequestArgs);
});
callback(null, res);
break;
}
Expand Down

0 comments on commit 840aa6a

Please sign in to comment.