File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -353,14 +353,14 @@ exports.addProjectTopicKey = functions.https.onRequest(async (_, res) => {
353353 const isEmptyProject = Object . keys ( data ) . length === 0 ;
354354 if ( isEmptyProject ) {
355355 res . status ( 404 ) . send ( 'No projects found' ) ;
356- }
357-
358- if ( ! isEmptyProject && data ) {
356+ } else {
359357 const newProjectData : { [ key : string ] : string } = { } ;
360358
361359 Object . keys ( data ) . forEach ( ( id ) => {
362- if ( data [ id ] ?. projectTopic ) {
363- const newProjectTopicKey = formatProjectTopic ( data [ id ] . projectTopic ) ;
360+ const projectData = data [ id ] ;
361+
362+ if ( projectData ?. name ) {
363+ const newProjectTopicKey = formatProjectTopic ( projectData . name ) ;
364364 newProjectData [ `v2/projects/${ id } /projectTopicKey` ] = newProjectTopicKey ;
365365 }
366366 } ) ;
@@ -383,9 +383,7 @@ exports.addUserNameLowercase = functions.https.onRequest(async (_, res) => {
383383 const isEmptyUser = Object . keys ( data ) . length === 0 ;
384384 if ( isEmptyUser ) {
385385 res . status ( 404 ) . send ( 'No user found' ) ;
386- }
387-
388- if ( ! isEmptyUser && data ) {
386+ } else {
389387 const newUserData : { [ key : string ] : string } = { } ;
390388
391389 Object . keys ( data ) . forEach ( ( id ) => {
You can’t perform that action at this time.
0 commit comments