Skip to content

Commit 4045f4e

Browse files
committed
fix create event button
1 parent 767ca17 commit 4045f4e

5 files changed

Lines changed: 49 additions & 34 deletions

File tree

public/swagger/swagger.json

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@
971971
"content": {
972972
"application/json": {
973973
"schema": {
974-
"$ref": "#/components/schemas/UsersAndPagination"
974+
"$ref": "#/components/schemas/InvitesGroupsAndPagination"
975975
}
976976
}
977977
}
@@ -1263,23 +1263,7 @@
12631263
"content": {
12641264
"application/json": {
12651265
"schema": {
1266-
"type": "object",
1267-
"required": [
1268-
"users",
1269-
"nextPageToken"
1270-
],
1271-
"properties": {
1272-
"users": {
1273-
"type": "array",
1274-
"items": {
1275-
"$ref": "#/components/schemas/User"
1276-
}
1277-
},
1278-
"nextPageToken": {
1279-
"type": "integer",
1280-
"format": "uint32"
1281-
}
1282-
}
1266+
"$ref": "#/components/schemas/UsersAndPagination"
12831267
}
12841268
}
12851269
}
@@ -2443,6 +2427,7 @@
24432427
},
24442428
"attendees": {
24452429
"type": "array",
2430+
"nullable": true,
24462431
"items": {
24472432
"type": "integer",
24482433
"format": "uint32",
@@ -3273,12 +3258,27 @@
32733258
"name"
32743259
]
32753260
},
3276-
"UsersAndPagination": {
3261+
"InvitesGroupsAndPagination": {
32773262
"type": "object",
3263+
"properties": {
3264+
"invites": {
3265+
"type": "array",
3266+
"items": {
3267+
"$ref": "#/components/schemas/InvitesGroup"
3268+
}
3269+
},
3270+
"nextPageToken": {
3271+
"type": "integer",
3272+
"format": "uint32"
3273+
}
3274+
},
32783275
"required": [
3279-
"users",
3276+
"invites",
32803277
"nextPageToken"
3281-
],
3278+
]
3279+
},
3280+
"UsersAndPagination": {
3281+
"type": "object",
32823282
"properties": {
32833283
"users": {
32843284
"type": "array",
@@ -3290,7 +3290,11 @@
32903290
"type": "integer",
32913291
"format": "uint32"
32923292
}
3293-
}
3293+
},
3294+
"required": [
3295+
"users",
3296+
"nextPageToken"
3297+
]
32943298
}
32953299
}
32963300
}

shared

src/app/dashboard/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export default function Dashboard() {
122122
}
123123

124124
return (
125-
<div className='flex flex-col justify-start items-center pt-10 h-[90vh] w-screen overflow-hidden'>
125+
<div className='flex flex-col justify-start items-center pt-10 h-[90vh] w-screen'>
126126
<User />
127127
<div className='flex flex-row justify-center w-screen gap-10 mt-5'>
128128
<div className='w-[45vw]'>

src/components/calendar-overview.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,12 @@ export function CalendarOverview() {
407407
<CreateEvent
408408
open={isCreateEventOpen}
409409
onOpenChangeAction={setIsCreateEventOpen}
410-
closeCreateEventDialogOpen={closeCreateEventDialogOpen}
410+
closeCreateEventDialogOpen={() => setIsCreateEventOpen(false)}
411+
initialTitle={''}
412+
initialDuration={'1hr'}
413+
initialParticipants={[]}
414+
initialSelectedRange={null}
415+
inputsDisabled={false}
411416
/>
412417

413418
<Dialog

src/types/client.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type ReschedulingRequestNewMeeting = {
3030
startTime: string;
3131
endTime: string;
3232
location: string;
33-
attendees: Array<number>;
33+
attendees: Array<number> | null;
3434
};
3535
type ReschedulingCheckBodySchema = {
3636
newMeeting: {
@@ -181,6 +181,10 @@ type InvitesMe = {
181181
fromUserFirstName: string;
182182
fromUserLastName: string;
183183
};
184+
type InvitesGroupsAndPagination = {
185+
invites: Array<InvitesGroup>;
186+
nextPageToken: number;
187+
};
184188
type UsersAndPagination = {
185189
users: Array<User>;
186190
nextPageToken: number;
@@ -307,13 +311,16 @@ const InvitesGroup: z.ZodType<InvitesGroup> = z
307311
createdAt: z.string().datetime({ offset: true }),
308312
})
309313
.passthrough();
310-
const UsersAndPagination: z.ZodType<UsersAndPagination> = z
311-
.object({ users: z.array(User), nextPageToken: z.number().int() })
314+
const InvitesGroupsAndPagination: z.ZodType<InvitesGroupsAndPagination> = z
315+
.object({ invites: z.array(InvitesGroup), nextPageToken: z.number().int() })
312316
.passthrough();
313317
const SlotifyGroup = z
314318
.object({ id: z.number().int(), name: z.string() })
315319
.passthrough();
316320
const SlotifyGroupCreate = z.object({ name: z.string() }).passthrough();
321+
const UsersAndPagination: z.ZodType<UsersAndPagination> = z
322+
.object({ users: z.array(User), nextPageToken: z.number().int() })
323+
.passthrough();
317324
const EmailAddress: z.ZodType<EmailAddress> = z
318325
.object({ address: z.string().email(), name: z.string() })
319326
.passthrough();
@@ -443,7 +450,7 @@ const ReschedulingRequestNewMeeting: z.ZodType<ReschedulingRequestNewMeeting> =
443450
startTime: z.string().datetime({ offset: true }),
444451
endTime: z.string().datetime({ offset: true }),
445452
location: z.string(),
446-
attendees: z.array(z.number().int()),
453+
attendees: z.array(z.number().int()).nullable(),
447454
})
448455
.passthrough();
449456
const RescheduleRequest: z.ZodType<RescheduleRequest> = z
@@ -506,9 +513,10 @@ export const schemas = {
506513
InvitesMe,
507514
InviteCreate,
508515
InvitesGroup,
509-
UsersAndPagination,
516+
InvitesGroupsAndPagination,
510517
SlotifyGroup,
511518
SlotifyGroupCreate,
519+
UsersAndPagination,
512520
EmailAddress,
513521
AttendeeBase,
514522
PhysicalAddress,
@@ -1718,7 +1726,7 @@ const endpoints = makeApi([
17181726
schema: z.number().int(),
17191727
},
17201728
],
1721-
response: UsersAndPagination,
1729+
response: InvitesGroupsAndPagination,
17221730
errors: [
17231731
{
17241732
status: 400,
@@ -1800,9 +1808,7 @@ const endpoints = makeApi([
18001808
schema: z.string().optional(),
18011809
},
18021810
],
1803-
response: z
1804-
.object({ users: z.array(User), nextPageToken: z.number().int() })
1805-
.passthrough(),
1811+
response: UsersAndPagination,
18061812
errors: [
18071813
{
18081814
status: 401,

0 commit comments

Comments
 (0)