RobinBobin / react-native-google-drive-api-wrapper

This wrapper facilitates the use of the Google Drive API in React Native projects.
110 stars 43 forks source link

Add files.update #32

Closed mmoonn2 closed 4 years ago

mmoonn2 commented 4 years ago

Example.

async moveFile(file_id, parent_id, oparent_id) {
        let data = await GDrive.files.update(file_id, {
            removeParents: oparent_id,
            addParents: parent_id,
            resource: {
                modifiedTime: new Date(Date.now()).toISOString(),
            },
        }).then(response => response.json())

        return data
}

resource is Request body Same as google-api-nodejs-client

RobinBobin commented 4 years ago

Hello, Moon!

Thanks for the update. I'll gladly merge it. I'd like to kindly ask you to increase the version to 1.4.0 in package.json and add a couple of words to the readme. A link to the google api docs and an example will be great. And maybe the missing semicolons at the end of the lines in your code. I know it's nothing much, but that way it will look consistent with my code.

Thanks.

mmoonn2 commented 4 years ago

Is this right?

mmoonn2 commented 4 years ago

I newly added Delete Permission and About

        let data = await GDrive.about.get({
            fields: 'storageQuota'
        }).then(response => response.json())

        await GDrive.permissions.delete(file_id, permissionId)
RobinBobin commented 4 years ago

Yeah, that's great. Thanks. Merged.

hjylewis commented 3 years ago

@RobinBobin can this change be published?

RobinBobin commented 3 years ago

Done.