File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -37,13 +37,13 @@ export default {
3737 if ( ! mainField ) return ;
3838
3939 const fieldsArr : string [ ] = [ 'documentId' , ...( mainField ? [ mainField ] : [ ] ) ] ;
40-
4140 const entries = ( await strapi . documents ( uid ) . findMany ( {
4241 filters : {
4342 [ mainField ] : { $containsi : qStr } ,
4443 } ,
44+ // @ts -expect-error
4545 fields : fieldsArr ,
46- } as any ) ) as unknown as DocumentEntry [ ] ;
46+ } ) ) ;
4747
4848 if ( ! entries || entries . length === 0 ) return ;
4949
@@ -76,8 +76,9 @@ export default {
7676 . documents ( contentType as UID . ContentType )
7777 . findOne ( {
7878 documentId,
79+ // @ts -expect-error
7980 fields : fieldsArr ,
80- } as any ) ) as unknown as DocumentEntry | null ;
81+ } ) ) ;
8182
8283 if ( ! entry ) {
8384 throw new errors . NotFoundError ( 'Entry not found' ) ;
@@ -86,6 +87,7 @@ export default {
8687 ctx . body = {
8788 id : entry . id ,
8889 documentId : entry . documentId ,
90+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
8991 ...( mainField ? { [ mainField ] : entry [ mainField ] } : { } ) ,
9092 } ;
9193 } ,
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ interface ContentManagerConfig {
88
99export const getMainField = async ( uid : UID . ContentType ) : Promise < string | null > => {
1010 const coreStoreSettings = ( await strapi
11- . query ( 'strapi::core-store' as unknown as UID . Schema )
11+ // TODO use documents service instead of any
12+ . query ( 'strapi::core-store' as UID . Schema )
1213 . findMany ( {
1314 where : { key : `plugin_content_manager_configuration_content_types::${ uid } ` } ,
1415 } ) ) as Array < { value : string } > ;
You can’t perform that action at this time.
0 commit comments