Skip to content

Commit

Permalink
fix: update method to use object.update etc
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Oct 30, 2023
1 parent 1fac4cc commit d412fe0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ async function upload(element, data) {
}
}

Data.method = 'update.' + Data.type
Data.method = Data.type + '.update'
let response = await Crud.send(Data)({
array,
object,
Expand Down Expand Up @@ -459,7 +459,7 @@ async function Import(element, data) {

if (data.length) {
for (let i = 0; i < data.length; i++) {
data[i].method = 'create.' + data[i].type
data[i].method = data[i].type + '.create'
data[i] = await Crud.send(data[i])
}
}
Expand Down Expand Up @@ -502,7 +502,7 @@ async function Export(element, data) {

if (Data.type === 'key')
Data.type = 'object'
Data.method = 'read.' + Data.type
Data.method = Data.type + '.read'
Data = await Crud.send(Data)
data.push(...Data[Data.type])

Expand Down
4 changes: 2 additions & 2 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,13 @@ module.exports = async function file(CoCreateConfig, configPath, match) {
let response;
if (!data.object._id && !data.$filter) {
response = await crud.send({
method: 'create.object',
method: 'object.create',
...config,
...data
})
} else {
response = await crud.send({
method: 'update.object',
method: 'object.update',
...config,
...data,
upsert: true
Expand Down

0 comments on commit d412fe0

Please sign in to comment.