File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,16 @@ const capabilities = await fetchGetCapabilities(cswTestUrl);
13
13
console . log ( capabilities ) ;
14
14
15
15
let describeRecordUrl = capabilities . operations . find ( operation => operation . name === 'DescribeRecord' ) ?. getUrls [ 0 ] ;
16
- const describeRecord = await fetchDescribeRecord ( describeRecordUrl , capabilities . serviceTypeVersion ) ;
16
+ let describeRecord = await fetchDescribeRecord ( describeRecordUrl , capabilities . serviceTypeVersion ) ;
17
+ if ( describeRecord . error && describeRecord . error . indexOf ( 'status' ) > - 1 && describeRecord . error . indexOf ( '404' ) > - 1 ) {
18
+ describeRecord = await fetchDescribeRecord ( cswTestUrl , capabilities . serviceTypeVersion ) ;
19
+ }
17
20
console . log ( describeRecord ) ;
18
21
19
22
const getRecordsUrl = capabilities . operations . find ( operation => operation . name === 'GetRecords' ) ?. getUrls [ 0 ] ;
20
- const getRecords = await fetchGetRecords ( getRecordsUrl , capabilities . serviceTypeVersion ) ;
21
- //console.log(getRecords);
23
+ const elementSetName = 'brief' ;
24
+ let getRecords = await fetchGetRecords ( getRecordsUrl , capabilities . serviceTypeVersion , elementSetName ) ;
25
+ if ( getRecords . error && getRecords . error . indexOf ( 'status' ) > - 1 && getRecords . error . indexOf ( '404' ) > - 1 ) {
26
+ getRecords = await fetchGetRecords ( cswTestUrl , capabilities . serviceTypeVersion , elementSetName ) ;
27
+ }
28
+ console . log ( getRecords ) ;
You can’t perform that action at this time.
0 commit comments