File tree Expand file tree Collapse file tree 3 files changed +6
-24
lines changed Expand file tree Collapse file tree 3 files changed +6
-24
lines changed Original file line number Diff line number Diff line change @@ -373,7 +373,6 @@ export class AtlasUserData<T extends z.Schema> extends IUserData<T> {
373373 data : [ ] ,
374374 errors : [ ] ,
375375 } ;
376- // debugger;
377376 try {
378377 const response = await this . authenticatedFetch (
379378 this . getResourceUrl (
Original file line number Diff line number Diff line change @@ -48,8 +48,6 @@ export class CompassPipelineStorage implements PipelineStorage {
4848 try {
4949 const { data } = await this . userData . readAll ( ) ;
5050 return data ;
51- const { data } = await this . userData . readAll ( ) ;
52- return data ;
5351 } catch {
5452 return [ ] ;
5553 }
@@ -73,31 +71,17 @@ export class CompassPipelineStorage implements PipelineStorage {
7371 }
7472
7573 async create ( data : Omit < SavedPipeline , 'lastModified' > ) : Promise < boolean > {
76- try {
77- await this . userData . write ( data . id , {
78- ...data ,
79- lastModified : Date . now ( ) ,
80- } ) ;
81- return true ;
82- } catch {
83- return false ;
84- }
74+ return await this . userData . write ( data . id , {
75+ ...data ,
76+ lastModified : Date . now ( ) ,
77+ } ) ;
8578 }
8679
8780 async updateAttributes (
8881 id : string ,
8982 attributes : Partial < SavedPipeline >
9083 ) : Promise < boolean > {
91- try {
92- await this . userData . write ( id , {
93- ...( await this . userData . readOne ( id ) ) ,
94- ...attributes ,
95- lastModified : Date . now ( ) ,
96- } ) ;
97- return true ;
98- } catch {
99- return false ;
100- }
84+ return await this . userData . updateAttributes ( id , attributes ) ;
10185 }
10286
10387 async delete ( id : string ) {
Original file line number Diff line number Diff line change @@ -61,8 +61,7 @@ export const PipelineSchema = z.preprocess(
6161 host : z . string ( ) . nullable ( ) . optional ( ) ,
6262 pipelineText : z . string ( ) ,
6363 lastModified : z
64- . number ( )
65- . default ( 0 )
64+ . union ( [ z . coerce . date ( ) , z . number ( ) ] )
6665 . transform ( ( x ) => new Date ( x ) ) ,
6766 } )
6867) ;
You can’t perform that action at this time.
0 commit comments