mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-31 01:47:13 +00:00 
			
		
		
		
	Merge pull request #14996 from jimmywarting/feature/remove_some_lodash
replace some lodash function with native
This commit is contained in:
		
						commit
						ae92b23f2a
					
				| @ -12,7 +12,6 @@ import { | |||||||
| } from '@strapi/helper-plugin'; | } from '@strapi/helper-plugin'; | ||||||
| import { Main } from '@strapi/design-system/Main'; | import { Main } from '@strapi/design-system/Main'; | ||||||
| import { Formik } from 'formik'; | import { Formik } from 'formik'; | ||||||
| import { get } from 'lodash'; |  | ||||||
| import { useRouteMatch, useHistory } from 'react-router-dom'; | import { useRouteMatch, useHistory } from 'react-router-dom'; | ||||||
| import { useQuery } from 'react-query'; | import { useQuery } from 'react-query'; | ||||||
| import { formatAPIErrors } from '../../../../../utils'; | import { formatAPIErrors } from '../../../../../utils'; | ||||||
| @ -205,12 +204,12 @@ const ApiTokenCreateView = () => { | |||||||
|       if (err?.response?.data?.error?.message === MSG_ERROR_NAME_TAKEN) { |       if (err?.response?.data?.error?.message === MSG_ERROR_NAME_TAKEN) { | ||||||
|         toggleNotification({ |         toggleNotification({ | ||||||
|           type: 'warning', |           type: 'warning', | ||||||
|           message: get(err, 'response.data.message', 'notification.error.tokennamenotunique'), |           message: err.response.data.message || 'notification.error.tokennamenotunique', | ||||||
|         }); |         }); | ||||||
|       } else { |       } else { | ||||||
|         toggleNotification({ |         toggleNotification({ | ||||||
|           type: 'warning', |           type: 'warning', | ||||||
|           message: get(err, 'response.data.message', 'notification.error'), |           message: err?.response?.data?.message || 'notification.error', | ||||||
|         }); |         }); | ||||||
|       } |       } | ||||||
|       unlockApp(); |       unlockApp(); | ||||||
|  | |||||||
| @ -1,6 +1,5 @@ | |||||||
| import React, { useState, useEffect } from 'react'; | import React, { useState, useEffect } from 'react'; | ||||||
| import { useIntl } from 'react-intl'; | import { useIntl } from 'react-intl'; | ||||||
| import { get } from 'lodash'; |  | ||||||
| import { | import { | ||||||
|   getYupInnerErrors, |   getYupInnerErrors, | ||||||
|   CheckPagePermissions, |   CheckPagePermissions, | ||||||
| @ -63,7 +62,7 @@ const SettingsPage = () => { | |||||||
| 
 | 
 | ||||||
|         setConfig(config); |         setConfig(config); | ||||||
| 
 | 
 | ||||||
|         const testAddressFound = get(config, 'settings.testAddress'); |         const testAddressFound = config?.settings?.testAddress; | ||||||
| 
 | 
 | ||||||
|         if (testAddressFound) { |         if (testAddressFound) { | ||||||
|           setTestAddress(testAddressFound); |           setTestAddress(testAddressFound); | ||||||
|  | |||||||
							
								
								
									
										4
									
								
								packages/core/email/server/bootstrap.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								packages/core/email/server/bootstrap.js
									
									
									
									
										vendored
									
									
								
							| @ -1,9 +1,7 @@ | |||||||
| 'use strict'; | 'use strict'; | ||||||
| 
 | 
 | ||||||
| const _ = require('lodash'); |  | ||||||
| 
 |  | ||||||
| const createProvider = (emailConfig) => { | const createProvider = (emailConfig) => { | ||||||
|   const providerName = _.toLower(emailConfig.provider); |   const providerName = emailConfig.provider.toLowerCase(); | ||||||
|   let provider; |   let provider; | ||||||
| 
 | 
 | ||||||
|   let modulePath; |   let modulePath; | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| 'use strict'; | 'use strict'; | ||||||
| 
 | 
 | ||||||
| const { isNil, pick } = require('lodash/fp'); | const { pick } = require('lodash/fp'); | ||||||
| const { ApplicationError } = require('@strapi/utils').errors; | const { ApplicationError } = require('@strapi/utils').errors; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
| @ -29,7 +29,7 @@ module.exports = { | |||||||
|   async test(ctx) { |   async test(ctx) { | ||||||
|     const { to } = ctx.request.body; |     const { to } = ctx.request.body; | ||||||
| 
 | 
 | ||||||
|     if (isNil(to)) { |     if (!to) { | ||||||
|       throw new ApplicationError('No recipient(s) are given'); |       throw new ApplicationError('No recipient(s) are given'); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Julie Plantey
						Julie Plantey