Open
Conversation
daohoangson
reviewed
Dec 9, 2018
Contributor
daohoangson
left a comment
There was a problem hiding this comment.
Điều chỉnh lại api route / params theo XF1 luôn nha https://repo.tinhte.vn/appforo/ApiGallery/tree/master/library/Appforo/ApiGallery/ControllerApi
| return $attachment; | ||
| } | ||
|
|
||
| public function doUploadAndRespond($hash, $contentType, $context, $formField = 'file') |
Contributor
There was a problem hiding this comment.
Tại sao cần implement cái này nhỉ?
Contributor
Author
There was a problem hiding this comment.
dạ bên POST /media lưu file thành attachment nhưng không respond cái attachment nên em tách ra cái function doUpload riêng
Contributor
There was a problem hiding this comment.
À hiểu rồi. Thôi như đã bàn thì cứ để nó upload riêng và save riêng nha.
| } | ||
|
|
||
| $params = $this->params() | ||
| ->define('category_id', 'int', '', -1) |
Contributor
There was a problem hiding this comment.
Mấy cái params cho thêm description đi chế.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented a working version of XFMG APIs which includes fundamental functionalities.
Implemented actions:
Album:
Media:
Comment:
Missing important actions:
Album:
Media:
Comment:
Concerns:
post_dateof posts are mapped topost_create_datein API response data, whilecomment_dateof xfmg comments are mapped tocomment_date. I'm not exactly sure what is our mapping convention, and whether XFMG APIs have to follow that convention.POST /mediauses afileparam to create an attachment record directly for the new media, while normally a separatePOST /attachmentscall is required. Although this is not similar to other APIs, I implemented this way because a media item always has exactly 1 attachment, and it will be much more convenient to create a media item via API this way