Skip to content
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

(ccc-libs)feat: Migrating saveFiles to cozy-client #909

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

LucsT
Copy link
Contributor

@LucsT LucsT commented Feb 2, 2023

Reporting the migration to cozy-client in saveFiles of the ccc-libs
Flagship app master Launch.js is already up-to-date for the new saveFiles prototype (client 1st arg)

@LucsT LucsT requested a review from a team as a code owner February 2, 2023 10:13
@@ -298,27 +300,35 @@ async function createFile(entry, options, method, fileId) {

let fileDocument
if (method === 'create') {
fileDocument = await cozy.files.create(toCreate, createFileOptions)
const clientResponse = await client.save({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On ne pourrait pas remplacer tout ça par

const clientResponse = await client.save({
  _type: 'io.cozy.files',
  type: 'file',
  data: toCreate,
  ...createFileOptions,
  ...(file?._id ? {
    _id: file._id,
    _rev: file._rev
  } : {})
})

Et du coup on n'aurait plus besoin de distinguer via "method"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comme précisé sur mattermost, sera traité dans une autre carte et est référencé par #908

@LucsT LucsT merged commit 7657878 into master Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants