Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- /divisions/name/:name
- /hwinfo/dtdata
- /riak/stats
- /stats_summary/create

## [4.0.0] - 2019-12-16
### Added
Expand Down
7 changes: 4 additions & 3 deletions traffic_ops/app/lib/API/StatsSummary.pm
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ sub create {
my $summary_time = $self->req->json->{summaryTime};
my $stat_date = $self->req->json->{statDate};

my $alternative = "POST /stats_summary";

if ( !defined($stat_name) || !defined($stat_value) || !defined($stat_date) ) {
$self->alert( { ERROR => "Please provide a stat name, value, and date" } );
return $self->with_deprecation("Please provide a stat name, value, and date", "error", 400, $alternative);
}

my $insert = $self->db->resultset('StatsSummary')->create(
Expand All @@ -96,8 +98,7 @@ sub create {
}
);
$insert->insert();

return $self->success("Successfully added stats summary record");
return $self->with_deprecation("Successfully added stats summary record", "success", 200, $alternative);
}

1;