Commit c7fc866 1 parent 7a2e717 commit c7fc866 Copy full SHA for c7fc866
File tree 1 file changed +6
-10
lines changed
src/api/clients/IOClients/infra
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export class VBase extends InfraClient {
22
22
} )
23
23
}
24
24
25
+ // Resolve a specific pages-graphql conflict
25
26
public resolveConflict = ( bucketKey : string , path : string , content : any ) => {
26
27
const data = [
27
28
{
@@ -36,22 +37,17 @@ export class VBase extends InfraClient {
36
37
} )
37
38
}
38
39
40
+ // List all conflicts in the pages-graphql bucket
39
41
public getConflicts = async ( ) => {
40
42
return this . http . get ( routes . Conflicts ( 'vtex.pages-graphql/userData' ) , {
41
43
metric : 'vbase-get-conflicts' ,
42
44
} )
43
45
}
44
46
47
+ // Verify if there is at least one conlfict in the pages-graphql bucket
45
48
public checkForConflicts = async ( ) => {
46
- let status : number
47
- try {
48
- const response = await this . http . get ( routes . File ( 'vtex.pages-graphql/userData' , 'store/content.json' ) , {
49
- metric : 'vbase-conflict' ,
50
- } )
51
- status = response . status
52
- } catch ( error ) {
53
- status = error . response && error . response . status
54
- }
55
- return status === 409
49
+ const response = await this . getConflicts ( ) . then ( res => res . data )
50
+
51
+ return response ?. data ?. length > 0
56
52
}
57
53
}
You can’t perform that action at this time.
0 commit comments