<commit_before>import React from 'react'
import { connect } from 'react-redux'

import { getResourceToVerify } from './action-creators'
import Button from '../components/button'
import Spacer from '../components/spacer'
import { store } from '../hah-app/index'

const updateForm = ({ changeFieldValue, resource }) => {
	const {
		name,
		address,
		hours,
		notes,
		phone,
		primaryContactUser,
		verified,
		website
	} = resource

	changeFieldValue('name', name)
	changeFieldValue('name-verified', verified.name)
	changeFieldValue('address1', address.line1)
	changeFieldValue('address2', address.line2)
	changeFieldValue('city', address.city)
	changeFieldValue('state', address.state)
	changeFieldValue('zip', address.zip)
	changeFieldValue('address-verified', verified.address)
	changeFieldValue('phone', phone)
	changeFieldValue('phone-verified', verified.phone)
	changeFieldValue('website', website)
	changeFieldValue('website-verified', verified.website)

	changeFieldValue('primary-contact-first-name', primaryContactUser.firstName)
	changeFieldValue('primary-contact-last-name', primaryContactUser.lastName)
	changeFieldValue('primary-contact-phone', primaryContactUser.phone)
	changeFieldValue('primary-contact-email', primaryContactUser.email)
	changeFieldValue('primary-contact-verified', verified.primaryContact)

	changeFieldValue('services-verified', verified.services)

	changeFieldValue('sunday-open', hours[0].open)
	changeFieldValue('sunday-close', hours[0].close)
	changeFieldValue('monday-open', hours[1].open)
	changeFieldValue('monday-close', hours[1].close)
	changeFieldValue('tuesday-open', hours[2].open)
	changeFieldValue('tuesday-close', hours[2].close)
	changeFieldValue('wednesday-open', hours[3].open)
	changeFieldValue('wednesday-close', hours[3].close)
	changeFieldValue('thursday-open', hours[4].open)
	changeFieldValue('thursday-close', hours[4].close)
	changeFieldValue('friday-open', hours[5].open)
	changeFieldValue('friday-close', hours[5].close)
	changeFieldValue('saturday-open', hours[6].open)
	changeFieldValue('saturday-close', hours[6].close)
	changeFieldValue('hours-verified', verified.hours)<commit_msg>Add services<commit_after>import React from 'react'
import { connect } from 'react-redux'
import _ from 'lodash'

import { getResourceToVerify } from './action-creators'
import Button from '../components/button'
import Spacer from '../components/spacer'
import { store } from '../hah-app/index'

const updateForm = ({ changeFieldValue, resource }) => {
	const {
		name,
		address,
		hours,
		notes,
		phone,
		primaryContactUser,
		services,
		verified,
		website
	} = resource

	changeFieldValue('name', name)
	changeFieldValue('name-verified', verified.name)
	changeFieldValue('address1', address.line1)
	changeFieldValue('address2', address.line2)
	changeFieldValue('city', address.city)
	changeFieldValue('state', address.state)
	changeFieldValue('zip', address.zip)
	changeFieldValue('address-verified', verified.address)
	changeFieldValue('phone', phone)
	changeFieldValue('phone-verified', verified.phone)
	changeFieldValue('website', website)
	changeFieldValue('website-verified', verified.website)

	changeFieldValue('primary-contact-first-name', primaryContactUser.firstName)
	changeFieldValue('primary-contact-last-name', primaryContactUser.lastName)
	changeFieldValue('primary-contact-phone', primaryContactUser.phone)
	changeFieldValue('primary-contact-email', primaryContactUser.email)
	changeFieldValue('primary-contact-verified', verified.primaryContact)

	_.each(services, service => {
		changeFieldValue(service, 1)
	})
	changeFieldValue('services-verified', verified.services)

	changeFieldValue('sunday-open', hours[0].open)
	changeFieldValue('sunday-close', hours[0].close)
	changeFieldValue('monday-open', hours[1].open)
	changeFieldValue('monday-close', hours[1].close)
	changeFieldValue('tuesday-open', hours[2].open)
	changeFieldValue('tuesday-close', hours[2].close)
	changeFieldValue('wednesday-open', hours[3].open)
	changeFieldValue('wednesday-close', hours[3].close)
	changeFieldValue('thursday-open', hours[4].open)
	changeFieldValue('thursday-close', hours[4].close)
	changeFieldValue('friday-open', hours[5].open)
	changeFieldValue('friday-close', hours[5].close)
	changeFieldValue('saturday-open', hours[6].open)
	changeFieldValue('saturday-close', hours[6].close)
	changeFieldValue('hours-verified', verified.hours)
{'fraction_non_alphanumeric': 0.145, 'fraction_numerical': 0.00840909090909091, 'mean_word_length': 7.351043643263757, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '531048', 'n_tokens_mistral': 1387, 'n_tokens_neox': 1341, 'n_words': 216}