Skip to content

Commit 1eb9c77

Browse files
committed
Merge branch 'ft-update-invitation' of https://github.com/atlp-rwanda/atlp-pulse-fn into ft-update-invitation
2 parents 9250d33 + b82aa07 commit 1eb9c77

File tree

3 files changed

+671
-18
lines changed

3 files changed

+671
-18
lines changed

src/Mutations/invitationStats.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
import { gql } from '@apollo/client';
22

33
export 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

src/components/ratings/AddNewRatings.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* istanbul ignore file */
22

33
import React from 'react';
4+
import { z } from 'zod';
45
import Button from '../Buttons';
56
import useAddRating from './hooks/useAddNewRating';
6-
import { z } from 'zod';
77

88
// Define the Zod schema
99
const 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

2323
interface 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 || '',

0 commit comments

Comments
 (0)