mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Adding regex op on long_description
This commit is contained in:
@@ -61,7 +61,9 @@ angular.module('Darkswarm').factory "EnterpriseRegistrationService", ($http, Reg
|
||||
enterprise = {}
|
||||
excluded = [ 'address', 'country', 'id' ]
|
||||
for key, value of @enterprise when key not in excluded
|
||||
enterprise[key] = value
|
||||
if (key == 'long_description')
|
||||
enterprise[key] = value.replace(/(?:\r\n|\r|\n)/g, '<br>')
|
||||
else enterprise[key] = value
|
||||
enterprise.address_attributes = @enterprise.address if @enterprise.address?
|
||||
enterprise.address_attributes.country_id = @enterprise.country.id if @enterprise.country?
|
||||
enterprise
|
||||
|
||||
Reference in New Issue
Block a user