mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	test: try using if statement
This commit is contained in:
		
							parent
							
								
									77754cc3d8
								
							
						
					
					
						commit
						3b2bf0dc35
					
				
					 1 changed files with 10 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -628,16 +628,19 @@ export default class Misskey implements MegalodonInterface {
 | 
			
		|||
      }
 | 
			
		||||
    }
 | 
			
		||||
    return this.client.post<Array<MisskeyAPI.Entity.UserDetail>>('/api/users/search', params).then(res => {
 | 
			
		||||
      if ((res.data as any)["error"]) {
 | 
			
		||||
        return Object.assign(res, {
 | 
			
		||||
          data: {
 | 
			
		||||
            accounts: [],
 | 
			
		||||
            statuses: [],
 | 
			
		||||
            hashtags: [],
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
      return Object.assign(res, {
 | 
			
		||||
        data: res.data.map(u => MisskeyAPI.Converter.userDetail(u, this.baseUrl))
 | 
			
		||||
      })
 | 
			
		||||
    }).catch(() => ({
 | 
			
		||||
      data: {
 | 
			
		||||
          accounts: [],
 | 
			
		||||
          statuses: [],
 | 
			
		||||
          hashtags: [],
 | 
			
		||||
      }
 | 
			
		||||
    }))
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  // ======================================
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue