@@ -2,14 +2,14 @@ import { Injectable } from "@angular/core";
22import { Store } from "@ngrx/store" ;
33import { combineLatest , Observable } from "rxjs" ;
44import { first , map } from "rxjs/operators" ;
5- import { Dataset , Job , User } from "state-management/models" ;
65import { submitJobAction } from "state-management/actions/jobs.actions" ;
76import {
87 selectCurrentUser ,
98 selectTapeCopies ,
109 selectProfile ,
1110} from "state-management/selectors/user.selectors" ;
1211import { RetrieveDestinations } from "app-config.service" ;
12+ import { DatasetClass , ReturnedUserDto } from "@scicatproject/scicat-sdk-ts" ;
1313
1414@Injectable ( )
1515export class ArchivingService {
@@ -19,12 +19,12 @@ export class ArchivingService {
1919 constructor ( private store : Store ) { }
2020
2121 private createJob (
22- user : User ,
23- datasets : Dataset [ ] ,
22+ user : ReturnedUserDto ,
23+ datasets : DatasetClass [ ] ,
2424 archive : boolean ,
2525 destinationPath ?: Record < string , string > ,
2626 // Do not specify tape copies here
27- ) : Job {
27+ ) {
2828 const extra = archive ? { } : destinationPath ;
2929 const jobParams = {
3030 username : user . username ,
@@ -46,11 +46,11 @@ export class ArchivingService {
4646 type : archive ? "archive" : "retrieve" ,
4747 } ;
4848
49- return new Job ( data ) ;
49+ return data ;
5050 }
5151
5252 private archiveOrRetrieve (
53- datasets : Dataset [ ] ,
53+ datasets : DatasetClass [ ] ,
5454 archive : boolean ,
5555 destPath ?: Record < string , string > ,
5656 ) : Observable < void > {
@@ -71,18 +71,18 @@ export class ArchivingService {
7171
7272 const job = this . createJob ( user , datasets , archive , destPath ) ;
7373
74- this . store . dispatch ( submitJobAction ( { job } ) ) ;
74+ this . store . dispatch ( submitJobAction ( { job : job as any } ) ) ;
7575 }
7676 } ) ,
7777 ) ;
7878 }
7979
80- public archive ( datasets : Dataset [ ] ) : Observable < void > {
80+ public archive ( datasets : DatasetClass [ ] ) : Observable < void > {
8181 return this . archiveOrRetrieve ( datasets , true ) ;
8282 }
8383
8484 public retrieve (
85- datasets : Dataset [ ] ,
85+ datasets : DatasetClass [ ] ,
8686 destinationPath : Record < string , string > ,
8787 ) : Observable < void > {
8888 return this . archiveOrRetrieve ( datasets , false , destinationPath ) ;
0 commit comments