[Bps-public-commit] rt-extension-rest2 branch, reminder, updated. 1.07-4-g42163e5
Michel Rodriguez
michel at bestpractical.com
Tue Aug 6 09:19:34 EDT 2019
The branch, reminder has been updated
via 42163e5a865bf0c47d80cc642741a944fd59a8cd (commit)
via 29df852ab5d6432a850c9650b4c553a1cc8dd1db (commit)
from 42f4387b2b56a15f76c46e61de617cbeb1eb3a12 (commit)
Summary of changes:
lib/RT/Extension/REST2.pm | 3 +++
lib/RT/Extension/REST2/Resource/Reminder.pm | 12 +++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)
- Log -----------------------------------------------------------------
commit 29df852ab5d6432a850c9650b4c553a1cc8dd1db
Author: michel <michel at bestpractical.com>
Date: Tue Aug 6 15:16:42 2019 +0200
Added first version of reminder access: GET /reminder/:id
diff --git a/lib/RT/Extension/REST2/Resource/Reminder.pm b/lib/RT/Extension/REST2/Resource/Reminder.pm
index 6d85707..06129e8 100644
--- a/lib/RT/Extension/REST2/Resource/Reminder.pm
+++ b/lib/RT/Extension/REST2/Resource/Reminder.pm
@@ -5,7 +5,7 @@ use warnings;
use Moose;
use namespace::autoclean;
-extends 'RT::Extension::REST2::Resource::Record';
+extends 'RT::Extension::REST2::Resource::Ticket';
with (
'RT::Extension::REST2::Resource::Record::Readable',
'RT::Extension::REST2::Resource::Record::Hypermedia'
@@ -68,6 +68,16 @@ sub create_record {
}
+sub serialize {
+ my $self= shift;
+ my $data = $self->SUPER::serialize();
+ my %keep_field = map { $_ => 1 } (qw( Owner Starts Queue Type Due Resolved id Subject Status LastUpdated LastUpdatedBy Created));
+ foreach my $field ( keys %$data) {
+ delete $data->{$field} if ! $keep_field{$field};
+ }
+ return $data;
+}
+
sub forbidden {
my $self = shift;
return 0 unless $self->record->id;
commit 42163e5a865bf0c47d80cc642741a944fd59a8cd
Author: michel <michel at bestpractical.com>
Date: Tue Aug 6 15:18:42 2019 +0200
Added GET /reminder/:id doc
diff --git a/lib/RT/Extension/REST2.pm b/lib/RT/Extension/REST2.pm
index a7f2023..dcc237b 100644
--- a/lib/RT/Extension/REST2.pm
+++ b/lib/RT/Extension/REST2.pm
@@ -358,6 +358,9 @@ Below are some examples using the endpoints above.
=head3 Reminders
+ GET /reminder/:id
+ retrieve a reminder
+
POST /reminder
create a reminder on a ticket
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list