Skip to content

Commit

Permalink
Documentation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
vboctor committed Jan 10, 2018
1 parent 95ed43f commit 62b61a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 0 additions & 3 deletions api/rest/restcore/issues_rest.php
Expand Up @@ -204,9 +204,6 @@ function rest_issue_note_add( \Slim\Http\Request $p_request, \Slim\Http\Response
}
}

# TODO: support reminder notes
# TODO: support note attachments

$t_command = new IssueNoteAddCommand( $t_data );
$t_command_response = $t_command->execute();

Expand Down
8 changes: 6 additions & 2 deletions core/commands/Command.php
Expand Up @@ -26,8 +26,12 @@
abstract class Command
{
/**
* This is the payload data for the command. Modelled after the REST
* API, this should be the body of the request.
* This is the data for the command. Modelled after the REST
* it has the following sub-arrays:
* 'query' - an array of url and query string parameters.
* 'payload' - the payload
* 'options' - options specified by the internal codebase and not
* as part of the request.
*
* @var array The input data for the command.
*/
Expand Down
7 changes: 5 additions & 2 deletions core/commands/IssueNoteAddCommand.php
Expand Up @@ -109,6 +109,9 @@ function validate() {
switch( $this->payload( 'type', 'note' ) ) {
case 'note':
case 'timelog':
# nothing to do here, the command will always set the
# type to `note` and core API will set to `timelog`
# when appropriate.
break;
case 'reminder': # isn't supported by this command.
default:
Expand Down Expand Up @@ -285,9 +288,9 @@ private function parseFiles() {
$t_files_required_fields = array();

$t_files_required_fields = array( 'name', 'tmp_name' );
for( $i = 0; $i < count( $this->files ); $i++ ) {
foreach( $this->files as $t_file ) {
foreach( $t_files_required_fields as $t_field ) {
if( !isset( $this->files[$i][$t_field] ) ) {
if( !isset( $t_file[$t_field] ) ) {
throw new ClientException(
sprintf( "File field '%s' is missing.", $t_field ),
ERROR_EMPTY_FIELD,
Expand Down

0 comments on commit 62b61a7

Please sign in to comment.