File tree Expand file tree Collapse file tree 3 files changed +671
-18
lines changed Expand file tree Collapse file tree 3 files changed +671
-18
lines changed Original file line number Diff line number Diff line change 11import { gql } from '@apollo/client' ;
22
33export const GET_INVITATIONS_STATISTICS_QUERY = gql `
4- query GetInvitationStatistics(
5- $orgToken: String!
6- $startDate: String
7- $endDate: String
8- $daysRange: Int
9- ) {
10- getInvitationStatistics(
11- orgToken: $orgToken
12- startDate: $startDate
13- endDate: $endDate
14- daysRange: $daysRange
15- ) {
4+ query GetInvitationStatistics($orgToken: String!) {
5+ getInvitationStatistics(orgToken: $orgToken) {
166 totalInvitations
177 pendingInvitationsCount
188 getPendingInvitationsPercentsCount
Original file line number Diff line number Diff line change 11/* istanbul ignore file */
22
33import React from 'react' ;
4+ import { z } from 'zod' ;
45import Button from '../Buttons' ;
56import useAddRating from './hooks/useAddNewRating' ;
6- import { z } from 'zod' ;
77
88// Define the Zod schema
99const ratingSchema = z . object ( {
@@ -17,7 +17,7 @@ interface RatingErrors {
1717 quality : string ;
1818 quantity : string ;
1919 professional : string ;
20- feedback :string ;
20+ feedback : string ;
2121}
2222
2323interface AddNewRatingsProps {
@@ -77,10 +77,13 @@ function AddNewRatings({
7777 } catch ( error ) {
7878 if ( error instanceof z . ZodError ) {
7979 // Handle validation errors
80- const errors : Partial < RatingErrors > = error . errors . reduce ( ( acc , err ) => {
81- acc [ err . path [ 0 ] as keyof RatingErrors ] = err . message ;
82- return acc ;
83- } , { } as Partial < RatingErrors > ) ;
80+ const errors : Partial < RatingErrors > = error . errors . reduce (
81+ ( acc , err ) => {
82+ acc [ err . path [ 0 ] as keyof RatingErrors ] = err . message ;
83+ return acc ;
84+ } ,
85+ { } as Partial < RatingErrors > ,
86+ ) ;
8487
8588 setRatingErrors ( {
8689 quality : errors . quality || '' ,
You can’t perform that action at this time.
0 commit comments