File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -532,7 +532,13 @@ export class DatabaseConnection {
532532 if ( q . item . _type === "role" && q . collectionname === "users" ) {
533533 q . item = await this . Cleanmembers ( q . item as any ) ;
534534 }
535- q . opresult = await this . db . collection ( q . collectionname ) . replaceOne ( _query , q . item , options ) ;
535+
536+ if ( q . collectionname != "fs.files" ) {
537+ q . opresult = await this . db . collection ( q . collectionname ) . replaceOne ( _query , q . item , options ) ;
538+ } else {
539+ var fsc = Config . db . db . collection ( "fs.files" ) ;
540+ q . opresult = await fsc . updateOne ( _query , { $set : { metadata : ( q . item as any ) . metadata } } ) ;
541+ }
536542 } else {
537543 if ( ( q . item [ "$set" ] ) === undefined ) { ( q . item [ "$set" ] ) = { } } ;
538544 ( q . item [ "$set" ] ) . _modifiedby = user . name ;
Original file line number Diff line number Diff line change @@ -1566,17 +1566,22 @@ module openflow {
15661566 if ( this . showjson ) {
15671567 this . model = JSON . parse ( this . jsonmodel ) ;
15681568 }
1569- if ( this . collection == "files" ) {
1570- await this . api . UpdateFile ( this . model . _id , ( this . model as any ) . metadata ) ;
1571- this . $location . path ( "/Files" ) ;
1572- if ( ! this . $scope . $$phase ) { this . $scope . $apply ( ) ; }
1573- return ;
1574- }
1569+ // if (this.collection == "files") {
1570+ // await this.api.UpdateFile(this.model._id, (this.model as any).metadata);
1571+ // this.$location.path("/Files");
1572+ // if (!this.$scope.$$phase) { this.$scope.$apply(); }
1573+ // return;
1574+ // }
15751575 if ( this . model . _id ) {
15761576 await this . api . Update ( this . collection , this . model ) ;
15771577 } else {
15781578 await this . api . Insert ( this . collection , this . model ) ;
15791579 }
1580+ if ( this . collection == "files" ) {
1581+ this . $location . path ( "/Files" ) ;
1582+ if ( ! this . $scope . $$phase ) { this . $scope . $apply ( ) ; }
1583+ return ;
1584+ }
15801585 this . $location . path ( "/Entities/" + this . collection ) ;
15811586 if ( ! this . $scope . $$phase ) { this . $scope . $apply ( ) ; }
15821587 }
Original file line number Diff line number Diff line change 1- 0.0.337
1+ 0.0.338
You can’t perform that action at this time.
0 commit comments