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

[FEATURE] Rest API upload file returns message object #13821

Merged
merged 8 commits into from
Oct 19, 2019

Conversation

knrt10
Copy link
Contributor

@knrt10 knrt10 commented Mar 20, 2019

Closes #13808

Docs PR

@sampaiodiego @tassoevan would you please review.

@knrt10 knrt10 changed the title Rest API upload file returns metadata [FIX] Rest API upload file returns metadata Mar 20, 2019
@engelgabriel engelgabriel added this to the 1.0.0 milestone Mar 21, 2019
Copy link
Member

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

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

@knrt10 I think the description of the issue says to return the message object and not the upload object. 🤔

@knrt10
Copy link
Contributor Author

knrt10 commented Mar 21, 2019

@MarcosSpessatto hmm, my bad. Let me fix this

@knrt10 knrt10 changed the title [FIX] Rest API upload file returns metadata [FIX] Rest API upload file returns message object Mar 21, 2019
@knrt10
Copy link
Contributor Author

knrt10 commented Mar 21, 2019

@MarcosSpessatto updated the PR.

Copy link
Member

@MarcosSpessatto MarcosSpessatto left a comment

Choose a reason for hiding this comment

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

Can you add some test case for this endpoint? I noticed that we don't have tests for rooms.upload. 😶 .
You can add the test in this file.
Here we have an example of how to do a test with upload

});

return API.v1.success();
return API.v1.success({ file: Messages.getMessageByFileIdAndUsername(fileData._id, this.userId) });
Copy link
Member

Choose a reason for hiding this comment

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

Can you change file to message?

@knrt10
Copy link
Contributor Author

knrt10 commented Mar 22, 2019

No problem, let me update tests

@knrt10
Copy link
Contributor Author

knrt10 commented Mar 24, 2019

@MarcosSpessatto tests updated, also a small fix was made when filefield name was other than file. Previously it was not sending a resposne. Now working fine. Please review.

@MarcosSpessatto
Copy link
Member

@knrt10 amazing. Thanks so much. 🥇

@knrt10
Copy link
Contributor Author

knrt10 commented Mar 26, 2019

No problem, happy to contribute

@knrt10 knrt10 changed the title [FIX] Rest API upload file returns message object [FEATURE] Rest API upload file returns message object Mar 27, 2019
@MarcosSpessatto MarcosSpessatto modified the milestones: 1.0.0, 1.1.0 Mar 29, 2019
@MarcosSpessatto MarcosSpessatto added this to the 1.0.0 milestone Mar 29, 2019
@sampaiodiego sampaiodiego modified the milestones: 1.0.0, 1.1.0 Apr 2, 2019
@rodrigok rodrigok added this to PRs in 1.1.0 Review May 10, 2019
@rodrigok rodrigok moved this from PRs to PRs 1.2.0 in 1.1.0 Review May 15, 2019
@rodrigok rodrigok modified the milestones: 1.1.0, 1.2.0 May 15, 2019
@rodrigok rodrigok removed this from PRs Next in 1.1.0 Review May 15, 2019
@engelgabriel engelgabriel modified the milestones: 1.2.0, 1.3.0 Jul 10, 2019
@sampaiodiego sampaiodiego modified the milestones: 1.3.0, 1.4.0 Jul 25, 2019
@sampaiodiego sampaiodiego modified the milestones: 2.0.0, 2.1.0 Sep 6, 2019
@engelgabriel engelgabriel modified the milestones: 2.1.0, 2.2.0 Oct 13, 2019
@rodrigok rodrigok merged commit cbe8986 into RocketChat:develop Oct 19, 2019
@rodrigok rodrigok mentioned this pull request Oct 27, 2019
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.

Rest API upload file get message
5 participants