Skip to content

Commit

Permalink
refactor: ⚰️ remove contributorId, unused key
Browse files Browse the repository at this point in the history
  • Loading branch information
clairenollet authored and this-is-tobi committed Jun 1, 2023
1 parent 626c031 commit 9edc04f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
4 changes: 0 additions & 4 deletions apps/server/src/models/organization.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ export const getOrganizationModel = () => Organization ?? (Organization = sequel
unique: true,
defaultValue: DataTypes.UUIDV4,
},
contributorId: {
type: DataTypes.STRING(50),
unique: true,
},
source: {
type: DataTypes.STRING(50),
},
Expand Down
2 changes: 0 additions & 2 deletions packages/shared/src/schemas/organization.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export const organizationSchema = Joi.object({
id: Joi.string()
.uuid(),

contributorId: Joi.string(),

source: Joi.string(),

name: Joi.string()
Expand Down
6 changes: 2 additions & 4 deletions packages/shared/src/utils/schemas.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ describe('Schemas utils', () => {
it('Should validate a correct organization schema with external data', () => {
expect(schemaValidator(organizationSchema, {
id: faker.datatype.uuid(),
contributorId: faker.word.noun(),
source: faker.word.noun(),
name: faker.word.noun(),
label: faker.company.name(),
Expand Down Expand Up @@ -89,12 +88,11 @@ describe('Schemas utils', () => {
it('Should not validate an organization schema with wrong external data', () => {
expect(schemaValidator(organizationSchema, {
id: faker.datatype.uuid(),
contributorId: faker.datatype.array(),
source: faker.word.noun(),
source: faker.datatype.array(),
name: faker.word.noun(),
label: faker.company.name(),
active: faker.datatype.boolean(),
})).toStrictEqual({ contributorId: '"contributorId" must be a string' })
})).toStrictEqual({ source: '"source" must be a string' })
})

it('Should not validate schema and send specific error', () => {
Expand Down

0 comments on commit 9edc04f

Please sign in to comment.