refactor(organizations/actions/orgs): avoid mutation of bucket in createOrgWithBucket

pull/14538/head
Michael Desa 2019-08-01 11:55:35 -04:00 committed by Christopher Henn
parent e1e4a574a3
commit 9cbb62cee5
1 changed files with 3 additions and 3 deletions

View File

@ -186,9 +186,9 @@ export const createOrgWithBucket = (
dispatch(addOrg(createdOrg)) dispatch(addOrg(createdOrg))
dispatch(push(`/orgs/${createdOrg.id}`)) dispatch(push(`/orgs/${createdOrg.id}`))
bucket.orgID = createdOrg.id const bucketResp = await api.postBucket({
data: {...bucket, orgID: createdOrg.id},
const bucketResp = await api.postBucket({data: bucket}) })
if (bucketResp.status !== 201) { if (bucketResp.status !== 201) {
throw new Error(bucketResp.data.message) throw new Error(bucketResp.data.message)