File tree Expand file tree Collapse file tree 6 files changed +30
-12
lines changed Expand file tree Collapse file tree 6 files changed +30
-12
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ export const dataModelResolvers = {
109109
110110 const { data : latestRevision } = await supabase
111111 . from ( "model_revision" )
112- . select ( "revision_number, hash " )
112+ . select ( "* " )
113113 . eq ( "model_id" , validatedInput . dataModelId )
114114 . order ( "revision_number" , { ascending : false } )
115115 . limit ( 1 )
@@ -152,8 +152,8 @@ export const dataModelResolvers = {
152152 language : validatedInput . language ,
153153 code : validatedInput . code ,
154154 cron : validatedInput . cron ,
155- start : validatedInput . start ,
156- end : validatedInput . end ,
155+ start : validatedInput . start ?. toISOString ( ) ?? null ,
156+ end : validatedInput . end ?. toISOString ( ) ?? null ,
157157 schema : validatedInput . schema . map ( ( col ) => ( {
158158 name : col . name ,
159159 type : col . type ,
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ import {
44 type Connection ,
55 emptyConnection ,
66} from "@/app/api/v1/osograph/utils/connection" ;
7- import type { ConnectionArgs } from "@/app/api/v1/osograph/utils/pagination" ;
7+ import type {
8+ ConnectionArgs ,
9+ FilterableConnectionArgs ,
10+ } from "@/app/api/v1/osograph/utils/pagination" ;
811import {
912 getFetchLimit ,
1013 getPaginationParams ,
@@ -54,7 +57,7 @@ export async function getUserOrganizationIds(
5457
5558export async function getUserOrganizationsConnection (
5659 userId : string ,
57- args : ConnectionArgs ,
60+ args : FilterableConnectionArgs ,
5861 additionalPredicate ?: Partial < QueryPredicate < "organizations" > > ,
5962) {
6063 const supabase = createAdminClient ( ) ;
@@ -101,6 +104,8 @@ export async function getUserOrganizationsConnection(
101104 supabase ,
102105 "organizations" ,
103106 predicate ,
107+ undefined ,
108+ args . single ,
104109 ) ;
105110
106111 if ( orgError ) {
Original file line number Diff line number Diff line change @@ -162,8 +162,8 @@ export const CreateDataModelRevisionSchema = z.object({
162162 language : z . string ( ) ,
163163 code : z . string ( ) ,
164164 cron : z . string ( ) ,
165- start : z . string ( ) . datetime ( ) . optional ( ) ,
166- end : z . string ( ) . datetime ( ) . optional ( ) ,
165+ start : z . date ( ) . optional ( ) ,
166+ end : z . date ( ) . optional ( ) ,
167167 schema : z . array ( DataModelColumnSchema ) ,
168168 dependsOn : z . array ( DataModelDependencySchema ) . optional ( ) ,
169169 partitionedBy : z . array ( z . string ( ) ) . optional ( ) ,
Original file line number Diff line number Diff line change @@ -285,7 +285,11 @@ const RenderField: React.FC<RenderFieldProps> = ({
285285 < div className = { cn ( horizontal && "col-span-3" ) } >
286286 < FormControl >
287287 < DatePicker
288- value = { field . value }
288+ value = {
289+ typeof field . value === "string"
290+ ? new Date ( field . value )
291+ : field . value
292+ }
289293 onChange = { field . onChange }
290294 disabled = { fieldSchema . disabled }
291295 />
@@ -350,7 +354,7 @@ const FormBuilder: React.FC<FormBuilderProps> = React.forwardRef(
350354 ref ,
351355 ( ) => ( {
352356 submit : ( ) => {
353- void form . handleSubmit ( onSubmit ) ( ) ;
357+ onSubmit ( form . getValues ( ) ) ;
354358 } ,
355359 } ) ,
356360 [ form . handleSubmit , onSubmit ] ,
Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ const MonacoEditorMeta: CodeComponentMeta<MonacoEditorProps> = {
1818 name : "MonacoEditor" ,
1919 description : "Monaco editor" ,
2020 props : {
21- defaultValue : {
22- type : "string" ,
23- } ,
2421 value : {
2522 type : "string" ,
23+ editOnly : true ,
24+ displayName : "Initial value" ,
25+ uncontrolledProp : "defaultValue" ,
2626 } ,
2727 onChange : {
2828 type : "eventHandler" ,
Original file line number Diff line number Diff line change @@ -2745,6 +2745,15 @@ class OsoAppClient {
27452745 kindOptions : any ;
27462746 } > ,
27472747 ) {
2748+ ensure ( args . dataModelId , "Missing dataModelId argument" ) ;
2749+ ensure ( args . name , "Missing name argument" ) ;
2750+ ensure ( args . displayName , "Missing displayName argument" ) ;
2751+ ensure ( args . language , "Missing language argument" ) ;
2752+ ensure ( args . code , "Missing code argument" ) ;
2753+ ensure ( args . cron , "Missing cron argument" ) ;
2754+ ensure ( args . schema , "Missing schema argument" ) ;
2755+ ensure ( args . kind , "Missing kind argument" ) ;
2756+
27482757 const CREATE_DATA_MODEL_REVISION_MUTATION = gql ( `
27492758 mutation CreateDataModelRevision($input: CreateDataModelRevisionInput!) {
27502759 createDataModelRevision(input: $input) {
You can’t perform that action at this time.
0 commit comments