Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefwint committed Oct 21, 2024
2 parents e5425d0 + e4001bf commit 2b02b61
Show file tree
Hide file tree
Showing 20 changed files with 510 additions and 138 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "module",
"dependencies": {
"@headlessui/react": "^1.7.17",
"@pzh-ui/components": "^0.0.572",
"@pzh-ui/components": "^0.0.575",
"@pzh-ui/config": "^0.0.70",
"@pzh-ui/css": "^0.0.100",
"@pzh-ui/icons": "^0.0.69",
Expand Down
32 changes: 16 additions & 16 deletions src/api/fetchers.msw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18771,6 +18771,21 @@ export const getPublicationVersionsVersionUuidAttachmentsPostMockHandler = (
)
}

export const getPublicationVersionsVersionUuidPdfExportPostMockHandler = () => {
return http.post(
'*/publication-versions/:versionUuid/pdf_export',
async () => {
await delay(1000)
return new HttpResponse(null, {
status: 200,
headers: {
'Content-Type': 'application/json',
},
})
}
)
}

export const getPublicationVersionsVersionUuidPackagesPostMockHandler = (
overrideResponse?:
| PublicationPackageCreatedResponse
Expand Down Expand Up @@ -18803,21 +18818,6 @@ export const getPublicationVersionsVersionUuidPackagesPostMockHandler = (
)
}

export const getPublicationVersionsVersionUuidPdfExportPostMockHandler = () => {
return http.post(
'*/publication-versions/:versionUuid/pdf_export',
async () => {
await delay(1000)
return new HttpResponse(null, {
status: 200,
headers: {
'Content-Type': 'application/json',
},
})
}
)
}

export const getPublicationActPackagesGetMockHandler = (
overrideResponse?:
| PagedResponsePublicationPackage
Expand Down Expand Up @@ -19605,8 +19605,8 @@ export const getOmgevingsbeleidAPIMock = () => [
getPublicationVersionsVersionUuidGetMockHandler(),
getPublicationVersionsVersionUuidPostMockHandler(),
getPublicationVersionsVersionUuidAttachmentsPostMockHandler(),
getPublicationVersionsVersionUuidPackagesPostMockHandler(),
getPublicationVersionsVersionUuidPdfExportPostMockHandler(),
getPublicationVersionsVersionUuidPackagesPostMockHandler(),
getPublicationActPackagesGetMockHandler(),
getPublicationActPackagesActPackageUuidDownloadGetMockHandler(),
getPublicationActPackagesActPackageUuidReportPostMockHandler(),
Expand Down
1 change: 1 addition & 0 deletions src/api/fetchers.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3799,6 +3799,7 @@ export interface ActCreate {
Document_Type: DocumentType
Environment_UUID: string
Title: string
Work_Other?: string
}

export interface AcknowledgedRelationSide {
Expand Down
104 changes: 52 additions & 52 deletions src/api/fetchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19423,159 +19423,159 @@ export const usePublicationVersionsVersionUuidAttachmentsPost = <
}

/**
* @summary Create new Publication Act Package
* @summary Download Publication Version as Pdf
*/
export const publicationVersionsVersionUuidPackagesPost = (
export const publicationVersionsVersionUuidPdfExportPost = (
versionUuid: string,
publicationPackageCreate: PublicationPackageCreate
publicationPackagePdf: PublicationPackagePdf
) => {
return customInstance<PublicationPackageCreatedResponse>({
url: `/publication-versions/${versionUuid}/packages`,
return customInstance<unknown>({
url: `/publication-versions/${versionUuid}/pdf_export`,
method: 'POST',
headers: { 'Content-Type': 'application/json' },
data: publicationPackageCreate,
data: publicationPackagePdf,
})
}

export const getPublicationVersionsVersionUuidPackagesPostMutationOptions = <
export const getPublicationVersionsVersionUuidPdfExportPostMutationOptions = <
TError = HTTPValidationError,
TContext = unknown
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof publicationVersionsVersionUuidPackagesPost>>,
Awaited<ReturnType<typeof publicationVersionsVersionUuidPdfExportPost>>,
TError,
{ versionUuid: string; data: PublicationPackageCreate },
{ versionUuid: string; data: PublicationPackagePdf },
TContext
>
}): UseMutationOptions<
Awaited<ReturnType<typeof publicationVersionsVersionUuidPackagesPost>>,
Awaited<ReturnType<typeof publicationVersionsVersionUuidPdfExportPost>>,
TError,
{ versionUuid: string; data: PublicationPackageCreate },
{ versionUuid: string; data: PublicationPackagePdf },
TContext
> => {
const { mutation: mutationOptions } = options ?? {}

const mutationFn: MutationFunction<
Awaited<ReturnType<typeof publicationVersionsVersionUuidPackagesPost>>,
{ versionUuid: string; data: PublicationPackageCreate }
Awaited<ReturnType<typeof publicationVersionsVersionUuidPdfExportPost>>,
{ versionUuid: string; data: PublicationPackagePdf }
> = props => {
const { versionUuid, data } = props ?? {}

return publicationVersionsVersionUuidPackagesPost(versionUuid, data)
return publicationVersionsVersionUuidPdfExportPost(versionUuid, data)
}

return { mutationFn, ...mutationOptions }
}

export type PublicationVersionsVersionUuidPackagesPostMutationResult =
export type PublicationVersionsVersionUuidPdfExportPostMutationResult =
NonNullable<
Awaited<ReturnType<typeof publicationVersionsVersionUuidPackagesPost>>
Awaited<ReturnType<typeof publicationVersionsVersionUuidPdfExportPost>>
>
export type PublicationVersionsVersionUuidPackagesPostMutationBody =
PublicationPackageCreate
export type PublicationVersionsVersionUuidPackagesPostMutationError =
export type PublicationVersionsVersionUuidPdfExportPostMutationBody =
PublicationPackagePdf
export type PublicationVersionsVersionUuidPdfExportPostMutationError =
HTTPValidationError

/**
* @summary Create new Publication Act Package
* @summary Download Publication Version as Pdf
*/
export const usePublicationVersionsVersionUuidPackagesPost = <
export const usePublicationVersionsVersionUuidPdfExportPost = <
TError = HTTPValidationError,
TContext = unknown
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof publicationVersionsVersionUuidPackagesPost>>,
Awaited<ReturnType<typeof publicationVersionsVersionUuidPdfExportPost>>,
TError,
{ versionUuid: string; data: PublicationPackageCreate },
{ versionUuid: string; data: PublicationPackagePdf },
TContext
>
}): UseMutationResult<
Awaited<ReturnType<typeof publicationVersionsVersionUuidPackagesPost>>,
Awaited<ReturnType<typeof publicationVersionsVersionUuidPdfExportPost>>,
TError,
{ versionUuid: string; data: PublicationPackageCreate },
{ versionUuid: string; data: PublicationPackagePdf },
TContext
> => {
const mutationOptions =
getPublicationVersionsVersionUuidPackagesPostMutationOptions(options)
getPublicationVersionsVersionUuidPdfExportPostMutationOptions(options)

return useMutation(mutationOptions)
}

/**
* @summary Download Publication Act as Pdf
* @summary Create new Publication Act Package
*/
export const publicationVersionsVersionUuidPdfExportPost = (
export const publicationVersionsVersionUuidPackagesPost = (
versionUuid: string,
publicationPackagePdf: PublicationPackagePdf
publicationPackageCreate: PublicationPackageCreate
) => {
return customInstance<unknown>({
url: `/publication-versions/${versionUuid}/pdf_export`,
return customInstance<PublicationPackageCreatedResponse>({
url: `/publication-versions/${versionUuid}/packages`,
method: 'POST',
headers: { 'Content-Type': 'application/json' },
data: publicationPackagePdf,
data: publicationPackageCreate,
})
}

export const getPublicationVersionsVersionUuidPdfExportPostMutationOptions = <
export const getPublicationVersionsVersionUuidPackagesPostMutationOptions = <
TError = HTTPValidationError,
TContext = unknown
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof publicationVersionsVersionUuidPdfExportPost>>,
Awaited<ReturnType<typeof publicationVersionsVersionUuidPackagesPost>>,
TError,
{ versionUuid: string; data: PublicationPackagePdf },
{ versionUuid: string; data: PublicationPackageCreate },
TContext
>
}): UseMutationOptions<
Awaited<ReturnType<typeof publicationVersionsVersionUuidPdfExportPost>>,
Awaited<ReturnType<typeof publicationVersionsVersionUuidPackagesPost>>,
TError,
{ versionUuid: string; data: PublicationPackagePdf },
{ versionUuid: string; data: PublicationPackageCreate },
TContext
> => {
const { mutation: mutationOptions } = options ?? {}

const mutationFn: MutationFunction<
Awaited<ReturnType<typeof publicationVersionsVersionUuidPdfExportPost>>,
{ versionUuid: string; data: PublicationPackagePdf }
Awaited<ReturnType<typeof publicationVersionsVersionUuidPackagesPost>>,
{ versionUuid: string; data: PublicationPackageCreate }
> = props => {
const { versionUuid, data } = props ?? {}

return publicationVersionsVersionUuidPdfExportPost(versionUuid, data)
return publicationVersionsVersionUuidPackagesPost(versionUuid, data)
}

return { mutationFn, ...mutationOptions }
}

export type PublicationVersionsVersionUuidPdfExportPostMutationResult =
export type PublicationVersionsVersionUuidPackagesPostMutationResult =
NonNullable<
Awaited<ReturnType<typeof publicationVersionsVersionUuidPdfExportPost>>
Awaited<ReturnType<typeof publicationVersionsVersionUuidPackagesPost>>
>
export type PublicationVersionsVersionUuidPdfExportPostMutationBody =
PublicationPackagePdf
export type PublicationVersionsVersionUuidPdfExportPostMutationError =
export type PublicationVersionsVersionUuidPackagesPostMutationBody =
PublicationPackageCreate
export type PublicationVersionsVersionUuidPackagesPostMutationError =
HTTPValidationError

/**
* @summary Download Publication Act as Pdf
* @summary Create new Publication Act Package
*/
export const usePublicationVersionsVersionUuidPdfExportPost = <
export const usePublicationVersionsVersionUuidPackagesPost = <
TError = HTTPValidationError,
TContext = unknown
>(options?: {
mutation?: UseMutationOptions<
Awaited<ReturnType<typeof publicationVersionsVersionUuidPdfExportPost>>,
Awaited<ReturnType<typeof publicationVersionsVersionUuidPackagesPost>>,
TError,
{ versionUuid: string; data: PublicationPackagePdf },
{ versionUuid: string; data: PublicationPackageCreate },
TContext
>
}): UseMutationResult<
Awaited<ReturnType<typeof publicationVersionsVersionUuidPdfExportPost>>,
Awaited<ReturnType<typeof publicationVersionsVersionUuidPackagesPost>>,
TError,
{ versionUuid: string; data: PublicationPackagePdf },
{ versionUuid: string; data: PublicationPackageCreate },
TContext
> => {
const mutationOptions =
getPublicationVersionsVersionUuidPdfExportPostMutationOptions(options)
getPublicationVersionsVersionUuidPackagesPostMutationOptions(options)

return useMutation(mutationOptions)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ const PublicationAnnouncementUpdateModal = () => {
)

const handleSubmit = (payload: PublicationAnnouncementEdit) => {
if (payload.Announcement_Date && payload.Procedural) {
payload.Procedural.Procedural_Announcement_Date =
payload.Announcement_Date
}

mutate({
announcementUuid: modalState?.announcementUuid,
data: payload,
Expand Down
Loading

0 comments on commit 2b02b61

Please sign in to comment.