Skip to content

Commit a08e498

Browse files
committed
fix: remove twitter field from facctory
1 parent d804ccd commit a08e498

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/pages/factory-classic/item-params.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,17 @@ import * as yup from 'yup'
1919
import styled from 'styled-components/macro'
2020
import CustomInput from 'components/custom-input'
2121
import ItemDetailsCard from 'components/item-details-card'
22-
import { ItemTypes } from '@kleros/gtcr-encoder'
22+
import { ItemTypes as AllItemTypes } from '@kleros/gtcr-encoder'
2323
import { STATUS_CODE } from 'utils/item-status'
2424

25+
const objectWithoutKey = (object, key) => {
26+
// eslint-disable-next-line no-unused-vars
27+
const { [key]: nothing, ...otherKeys } = object
28+
return otherKeys
29+
}
30+
31+
const ItemTypes = objectWithoutKey(AllItemTypes, 'TWITTER_USER_ID')
32+
2533
const { IMAGE, FILE, GTCR_ADDRESS, LONG_TEXT } = ItemTypes
2634

2735
const StyledAlert = styled(Alert)`

src/pages/factory/item-params.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,18 @@ import * as yup from 'yup'
1919
import styled from 'styled-components/macro'
2020
import CustomInput from 'components/custom-input'
2121
import ItemDetailsCard from 'components/item-details-card'
22-
import { ItemTypes } from '@kleros/gtcr-encoder'
22+
import { ItemTypes as AllItemTypes } from '@kleros/gtcr-encoder'
2323
import { STATUS_CODE } from 'utils/item-status'
2424

25-
const { IMAGE, FILE, GTCR_ADDRESS, LONG_TEXT } = ItemTypes
25+
const objectWithoutKey = (object, key) => {
26+
// eslint-disable-next-line no-unused-vars
27+
const { [key]: nothing, ...otherKeys } = object
28+
return otherKeys
29+
}
30+
31+
const ItemTypes = objectWithoutKey(AllItemTypes, 'TWITTER_USER_ID')
32+
33+
const { IMAGE, FILE, GTCR_ADDRESS, LONG_TEXT } = AllItemTypes
2634

2735
const StyledAlert = styled(Alert)`
2836
margin-bottom: 42px;

0 commit comments

Comments
 (0)