File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import { FileInterceptor } from '@nestjs/platform-express';
1818import { UserId } from 'omniboxd/decorators/user-id.decorator' ;
1919import { OpenCreateResourceDto } from 'omniboxd/namespace-resources/dto/open.create-resource.dto' ;
2020import { ResourceType } from 'omniboxd/resources/entities/resource.entity' ;
21+ import { isEmpty } from 'omniboxd/utils/is-empty' ;
2122
2223@Controller ( 'open/api/v1/resources' )
2324export class OpenResourcesController {
@@ -59,16 +60,16 @@ export class OpenResourcesController {
5960 resourceData ,
6061 ) ;
6162
62- if ( newResource . content && newResource . content . trim ( ) !== '' ) {
63- if ( ! newResource . name || newResource . name . trim ( ) === '' ) {
63+ if ( ! isEmpty ( newResource . content ?. trim ( ) ) ) {
64+ if ( isEmpty ( newResource . name ?. trim ( ) ) ) {
6465 await this . wizardTaskService . createGenerateTitleTask (
6566 userId ,
6667 apiKey . namespaceId ,
6768 { resource_id : newResource . id } ,
6869 { text : data . content } ,
6970 ) ;
7071 }
71- if ( ! newResource . tagIds ) {
72+ if ( isEmpty ( newResource . tagIds ) ) {
7273 await this . wizardTaskService . createExtractTagsTask (
7374 userId ,
7475 newResource . id ,
You can’t perform that action at this time.
0 commit comments