1- import { ResolverContextWithUser } from " ../types/graphql" ;
1+ import { ResolverContextWithUser } from ' ../types/graphql' ;
22import { ApolloError } from 'apollo-server-express' ;
3- import { ProjectEventGroupingPatternsDBScheme } from " @hawk.so/types" ;
3+ import { ProjectEventGroupingPatternsDBScheme } from ' @hawk.so/types' ;
44
55/**
66 * Type that represents payload for create project pattern mutation
@@ -24,26 +24,26 @@ interface UpdateProjectPatternMutationPayload {
2424 /**
2525 * Id of the pattern to be updated
2626 */
27- id : string ,
27+ id : string ;
2828
2929 /**
3030 * ProjectId of the pattern to be updated
3131 */
32- projectId : string ,
32+ projectId : string ;
3333
3434 /**
3535 * New pattern
3636 */
37- pattern : string ,
37+ pattern : string ;
3838} ;
3939
4040/**
4141 * Type that represents payload for remove project pattern mutation
4242 */
4343interface RemoveProjectPatternMutationPayload {
44- id : string ,
44+ id : string ;
4545
46- projectId : string ,
46+ projectId : string ;
4747}
4848
4949export default {
@@ -70,9 +70,9 @@ export default {
7070
7171 existingPatterns . forEach ( pattern => {
7272 if ( pattern . pattern . match ( new RegExp ( input . pattern ) ) || input . pattern . match ( new RegExp ( pattern . pattern ) ) ) {
73- throw new ApolloError ( 'New pattern collides with existing one' )
74- }
75- } )
73+ throw new ApolloError ( 'New pattern collides with existing one' ) ;
74+ }
75+ } ) ;
7676
7777 return await project . createProjectEventGroupingPattern ( { pattern : input . pattern } ) ;
7878 } ,
@@ -87,7 +87,7 @@ export default {
8787 async updateProjectEventGroupingPattern (
8888 _obj : undefined ,
8989 { input } : { input : UpdateProjectPatternMutationPayload } ,
90- { user, factories } : ResolverContextWithUser
90+ { user, factories } : ResolverContextWithUser
9191 ) : Promise < ProjectEventGroupingPatternsDBScheme > {
9292 const project = await factories . projectsFactory . findById ( input . projectId ) ;
9393
@@ -100,8 +100,8 @@ export default {
100100 existingPatterns . forEach ( pattern => {
101101 if ( pattern . _id . toString ( ) !== input . id ) {
102102 if ( pattern . pattern . match ( new RegExp ( input . pattern ) ) || input . pattern . match ( new RegExp ( pattern . pattern ) ) ) {
103- throw new ApolloError ( 'New pattern collides with existing one' )
104- }
103+ throw new ApolloError ( 'New pattern collides with existing one' ) ;
104+ }
105105 }
106106 } ) ;
107107
@@ -114,11 +114,11 @@ export default {
114114 * @param user - current authorized user {@see ../index.js}
115115 * @param factories - factories for working with models
116116 * @param input - input data for creating
117- */
117+ */
118118 async removeProjectEventGroupingPattern (
119119 obj : undefined ,
120120 { input } : { input : RemoveProjectPatternMutationPayload } ,
121- { user, factories } : ResolverContextWithUser
121+ { user, factories } : ResolverContextWithUser
122122 ) : Promise < ProjectEventGroupingPatternsDBScheme > {
123123 const project = await factories . projectsFactory . findById ( input . projectId ) ;
124124
@@ -127,6 +127,6 @@ export default {
127127 }
128128
129129 return await project . removeProjectEventGroupingPattern ( { id : input . id } ) ;
130- }
131- }
132- }
130+ } ,
131+ } ,
132+ } ;
0 commit comments