You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
export function updateResource(codigoTipoMedicamento, resource) {
const data = {
descricao: resource.descricao,
codigoBig: resource.codigoBig
};
return new Resource({
codigoTipoMedicamento
})
.save(data)
.then(resource => resource.refresh());
}
table structure in mysql/mariadb
The ERROR:
error: Error: ER_BAD_FIELD_ERROR: Unknown column 'codigoTipoMedicamento' in 'where clause'
at Query.Sequence._packetToError (/home/duard/projetoSIG/sigpharmaAPI/node_modules/mysql/lib/protocol/sequences/Sequence.js:52:14)
at Query.ErrorPacket (/home/duard/projetoSIG/sigpharmaAPI/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
at Protocol._parsePacket (/home/duard/projetoSIG/sigpharmaAPI/node_modules/mysql/lib/protocol/Protocol.js:279:23)
at Parser.write (/home/duard/projetoSIG/sigpharmaAPI/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/home/duard/projetoSIG/sigpharmaAPI/node_modules/mysql/lib/protocol/Protocol.js:39:16)
at Socket.<anonymous> (/home/duard/projetoSIG/sigpharmaAPI/node_modules/mysql/lib/Connection.js:103:28)
at Socket.emit (events.js:160:13)
at addChunk (_stream_readable.js:269:12)
at readableAddChunk (_stream_readable.js:256:11)
at Socket.Readable.push (_stream_readable.js:213:10)
at TCP.onread (net.js:599:20)
The text was updated successfully, but these errors were encountered:
Hi,
I'm using 'bookshelf-camelcase' plugin and that is my model class
I can succes insert a new record using that function createResource and passing this as parameters:
Parameters
Function
But when I try to UPDATE my record, using this parameters and function I get some error about the primarykey field name is incorrect:
Parameters to updateRecord function
Function updateRecord
table structure in mysql/mariadb
The ERROR:
The text was updated successfully, but these errors were encountered: