File tree Expand file tree Collapse file tree 2 files changed +20
-15
lines changed Expand file tree Collapse file tree 2 files changed +20
-15
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ const queries = {
32
32
{ input } : { input : GetFormResponsesByFormIdInput } ,
33
33
ctx : ServerContext
34
34
) => {
35
- ensureAuthenticated ( ctx )
36
- return FormService . getFormResponsesByFormId ( input . formId , ctx )
35
+ return FormService . getFormResponsesByFormId ( input . formId )
37
36
} ,
38
37
getFormResponsesByProjectId : async (
39
38
_ : any ,
Original file line number Diff line number Diff line change @@ -107,21 +107,27 @@ class FormService {
107
107
} )
108
108
}
109
109
110
- public static getFormResponsesByFormId ( formId : string , ctx : ServerContext ) {
111
- if ( ! ctx . user ?. id ) throw new AccessDeniedError ( )
112
-
110
+ public static getFormResponsesByFormId ( formId : string ) {
113
111
return prismaClient . formResponse . findMany ( {
114
112
where : {
115
- AND : [
116
- {
117
- form : {
118
- id : formId ,
119
- project : {
120
- ProjectAccessMapping : { every : { user : { id : ctx . user . id } } } , // TODO: Need to test more deeply
121
- } ,
122
- } ,
123
- } ,
124
- ] ,
113
+ formId,
114
+ } ,
115
+ orderBy : {
116
+ updatedAt : 'desc' ,
117
+ } ,
118
+ select : {
119
+ approved : true ,
120
+ company : true ,
121
+ createdAt : true ,
122
+ email : true ,
123
+ imageURL : true ,
124
+ id : true ,
125
+ jobTitle : true ,
126
+ rating : true ,
127
+ testimonial : true ,
128
+ name : true ,
129
+ websiteUrl : true ,
130
+ formId : true ,
125
131
} ,
126
132
} )
127
133
}
You can’t perform that action at this time.
0 commit comments