Append REST service for applications list (#2686)
This commit is contained in:
parent
0964eabe5e
commit
87395937ab
|
@ -247,8 +247,11 @@ sub init {
|
|||
->addAuthRoute(
|
||||
mysession => { ':sessionType' => 'updateMySession' },
|
||||
['PUT']
|
||||
);
|
||||
extends @parents if ($add);
|
||||
)
|
||||
|
||||
->addAuthRoute( myapplications => 'myApplications', ['GET'] );
|
||||
|
||||
extends @parents if ($add);
|
||||
$self->setTypes( $self->conf ) if ( $self->conf->{restSessionServer} );
|
||||
|
||||
return 1;
|
||||
|
@ -764,6 +767,26 @@ sub getUser {
|
|||
}
|
||||
}
|
||||
|
||||
sub myApplications {
|
||||
my ( $self, $req ) = @_;
|
||||
$req->sessionInfo( $req->userData );
|
||||
|
||||
my @appslist = map {
|
||||
my $category = $_;
|
||||
my @apps = map {
|
||||
{
|
||||
$_->{appname} => {
|
||||
AppUri => $_->{appuri},
|
||||
AppDesc => $_->{appdesc}
|
||||
}
|
||||
}
|
||||
} @{ $category->{applications} };
|
||||
{ Category => $category->{catname}, Applications => \@apps },
|
||||
} @{ $self->p->menu->appslist($req) };
|
||||
|
||||
return $self->p->sendJSONresponse( $req, { result => \@appslist } );
|
||||
}
|
||||
|
||||
sub _checkSecret {
|
||||
my ( $self, $secret ) = @_;
|
||||
my $isValid = 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user