Skip to content

Commit a9ce86d

Browse files
committed
Fix how Topics API controller accesses stashed CurrentUser object
1 parent ca2232f commit a9ce86d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/MediaWords/Controller/Api/V2/Topics.pm

+5-5
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ sub list_GET
118118

119119
my $db = $c->dbis;
120120

121-
my $auth_users_id = $c->stash->{ api_auth }->{ auth_users_id };
121+
my $auth_users_id = $c->stash->{ api_auth }->id();
122122

123123
my $topics = _get_topics_list( $db, $c->req->params, $auth_users_id );
124124

@@ -137,7 +137,7 @@ sub single_GET
137137
{
138138
my ( $self, $c, $topics_id ) = @_;
139139

140-
my $auth_users_id = $c->stash->{ api_auth }->{ auth_users_id };
140+
my $auth_users_id = $c->stash->{ api_auth }->id();
141141

142142
my $topics = _get_topics_list( $c->dbis, { topics_id => $topics_id }, $auth_users_id );
143143

@@ -238,7 +238,7 @@ sub create_GET
238238
my $media_ids = $data->{ media_ids } || [];
239239
my $media_tags_ids = $data->{ media_tags_ids } || [];
240240

241-
my $auth_users_id = $c->stash->{ api_auth }->{ auth_users_id };
241+
my $auth_users_id = $c->stash->{ api_auth }->id();
242242

243243
_validate_max_stories( $db, $data->{ max_stories }, $auth_users_id );
244244
$data->{ max_stories } ||= 100_000;
@@ -335,7 +335,7 @@ sub update_PUT
335335
$update->{ is_public } = normalize_boolean_for_db( $update->{ is_public } );
336336
$update->{ solr_seed_query_run } = normalize_boolean_for_db( $update->{ solr_seed_query_run } );
337337

338-
my $auth_users_id = $c->stash->{ api_auth }->{ auth_users_id };
338+
my $auth_users_id = $c->stash->{ api_auth }->id();
339339

340340
_validate_max_stories( $db, $data->{ max_stories }, $auth_users_id ) if ( defined( $data->{ max_stories } ) );
341341

@@ -384,7 +384,7 @@ sub spider_GET
384384
my $db = $c->dbis;
385385

386386
my $topic = $db->require_by_id( 'topics', $topics_id );
387-
my $auth_users_id = $c->stash->{ api_auth }->{ auth_users_id };
387+
my $auth_users_id = $c->stash->{ api_auth }->id();
388388

389389
if ( my $job_state = _get_user_public_queued_job( $db, $auth_users_id ) )
390390
{

0 commit comments

Comments
 (0)