-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JTR-116-fieldtypes #9
Conversation
@@ -62,6 +56,45 @@ class Schema { | |||
return schema.filter(({ name }) => !IGNORED_FIELDS.includes(name)); | |||
} | |||
|
|||
static _buildFieldTypesQuery(fieldTypes, currentFieldTypes) { | |||
|
|||
fieldTypes = this._buildFieldTypes(fieldTypes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓
fieldTypes
siempre llega?, siempre llega como objeto ?
Pregunto, porque no veo validación y como usas propiedades de Object.prototype
como entries
y por ahi si no llega bien ese dato se puede llegar a romper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lo mismo para currentFieldTypes
, pero con array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Ya vi que llegan siempre con el formato, correcto. Asi qu esta bien esta parte
lib/helpers/schema.js
Outdated
const fieldsToAdd = this._difference(schema, currentSchemas); | ||
|
||
const fieldsToReplace = this._difference(schema, fieldsToAdd) | ||
.filter(field => !currentSchemas.some(currentField => this._areEqualObjects(currentField, field))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕵️
Es lo mismo, escrito diferente, pero talvés agrega claridad a quien lo vaya a leer a futuro.
Que te parece ?
.filter(field => !currentSchemas.some(currentField => this._areEqualObjects(currentField, field))); | |
.filter(field => currentSchemas.every(currentField => !this._areEqualObjects(currentField, field))); |
lib/solr.js
Outdated
let res; | ||
|
||
try { | ||
|
||
const res = await this.request.get(endpoint); | ||
res = await this.request.get(endpoint); | ||
|
||
} catch(err) { | ||
throw err; | ||
} | ||
|
||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
El try/catch esta de más si no haces ningún proceso con eso
Sugiero :
const res = await this.request.get(endpoint);
Si request.get falla, va a throwear como esta pasando ahora
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aprobado!
LINK AL TICKET
https://fizzmod.atlassian.net/browse/JTR-116
DESCRIPCIÓN DEL REQUERIMIENTO
ping()
para arrojar un error en caso de falla.DESCRIPCIÓN DE LA SOLUCIÓN
Se realizaron los cambios solicitados