@@ -4,6 +4,7 @@ import { useCallback, useEffect, useMemo, useState } from "react";
4
4
import { useFormContext , useWatch } from "react-hook-form" ;
5
5
import { FormattedMessage , useIntl } from "react-intl" ;
6
6
import { ReactMarkdown } from "react-markdown/lib/react-markdown" ;
7
+ import { useParams } from "react-router-dom" ;
7
8
import { useUpdateEffect } from "react-use" ;
8
9
import * as yup from "yup" ;
9
10
@@ -20,11 +21,13 @@ import { Spinner } from "components/ui/Spinner";
20
21
import { Text } from "components/ui/Text" ;
21
22
22
23
import {
24
+ BuilderProjectWithManifest ,
23
25
GENERATE_CONTRIBUTION_NOTIFICATION_ID ,
24
26
useBuilderCheckContribution ,
25
27
useBuilderGenerateContribution ,
26
28
useGetBuilderProjectBaseImage ,
27
29
useListBuilderProjectVersions ,
30
+ useUpdateBuilderProject ,
28
31
} from "core/api" ;
29
32
import { CheckContributionRead } from "core/api/types/ConnectorBuilderClient" ;
30
33
import { useFormatError } from "core/errors" ;
@@ -427,6 +430,14 @@ const ContributeToAirbyte: React.FC<InnerModalProps> = ({ onClose, setPublishTyp
427
430
const [ imageNameError , setImageNameError ] = useState < string | null > ( null ) ;
428
431
const { mutateAsync : generateContribution , isLoading : isSubmittingContribution } = useBuilderGenerateContribution ( ) ;
429
432
433
+ const { projectId } = useParams < {
434
+ projectId : string ;
435
+ } > ( ) ;
436
+ if ( ! projectId ) {
437
+ throw new Error ( "Could not find project id in path" ) ;
438
+ }
439
+ const { mutateAsync : updateProject } = useUpdateBuilderProject ( projectId ) ;
440
+
430
441
const publishTypeSwitcher = < PublishTypeSwitcher selectedPublishType = "marketplace" setPublishType = { setPublishType } /> ;
431
442
432
443
if ( isLoadingBaseImage ) {
@@ -485,6 +496,14 @@ const ContributeToAirbyte: React.FC<InnerModalProps> = ({ onClose, setPublishTyp
485
496
manifest_yaml : convertJsonToYaml ( jsonManifestWithDescription ) ,
486
497
base_image : baseImage ,
487
498
} ) ;
499
+ const newProject : BuilderProjectWithManifest = {
500
+ name : values . name ,
501
+ manifest : jsonManifestWithDescription ,
502
+ yamlManifest : convertJsonToYaml ( jsonManifestWithDescription ) ,
503
+ contributionPullRequestUrl : contribution . pull_request_url ,
504
+ contributionActorDefinitionId : contribution . actor_definition_id ,
505
+ } ;
506
+ await updateProject ( newProject ) ;
488
507
registerNotification ( {
489
508
id : GENERATE_CONTRIBUTION_NOTIFICATION_ID ,
490
509
type : "success" ,
0 commit comments