Change getMimeType and setMimeType to response->content_type.
This commit is contained in:
parent
e5adc07a05
commit
fd8f03a186
52 changed files with 138 additions and 175 deletions
|
|
@ -527,7 +527,7 @@ parameter
|
|||
sub www_ajaxGetAddress {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
$session->http->setMimeType('text/plain');
|
||||
$session->response->content_type('text/plain');
|
||||
|
||||
my $addressId = $session->form->get('addressId');
|
||||
my $address = $self->getAddress($addressId) or return;
|
||||
|
|
@ -553,7 +553,7 @@ sub www_ajaxSave {
|
|||
else {
|
||||
$obj = $self->addAddress($address);
|
||||
}
|
||||
$session->http->setMimeType('text/plain');
|
||||
$session->response->content_type('text/plain');
|
||||
return $obj->getId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -942,7 +942,7 @@ sub www_ajaxPrices {
|
|||
$ship->getOptions($self);
|
||||
} || [],
|
||||
};
|
||||
$session->http->setMimeType('text/plain');
|
||||
$session->response->content_type('text/plain');
|
||||
return JSON->new->encode($response);
|
||||
}
|
||||
|
||||
|
|
@ -961,7 +961,7 @@ sub www_ajaxSetCartItemShippingId {
|
|||
my $item = $self->getItem($form->get('itemId'));
|
||||
my $address = $form->get('addressId') || undef;
|
||||
$item && $item->update({ shippingAddressId => $address });
|
||||
$session->http->setMimeType('text/plain');
|
||||
$session->response->content_type('text/plain');
|
||||
return 'ok';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -699,7 +699,7 @@ do whatever other activity a Sku purchase would allow.
|
|||
sub www_processRecurringTransactionPostback {
|
||||
my $self = shift;
|
||||
my $session = $self->session;
|
||||
$session->http->setMimeType('text/plain');
|
||||
$session->response->content_type('text/plain');
|
||||
my $form = $session->form;
|
||||
|
||||
# Get posted data of interest
|
||||
|
|
|
|||
|
|
@ -1079,7 +1079,7 @@ sub www_getTaxGroupsAsJSON {
|
|||
$group->{ isDefault } = 1 if $id eq $self->get( 'defaultGroup' );
|
||||
}
|
||||
|
||||
$self->session->http->setMimeType( 'application/json' );
|
||||
$self->session->response->content_type( 'application/json' );
|
||||
return to_json( { records => $taxGroups } );
|
||||
}
|
||||
|
||||
|
|
@ -1158,7 +1158,7 @@ sub www_getVATNumbersAsJSON {
|
|||
push @numbers, $number;
|
||||
}
|
||||
|
||||
$self->session->http->setMimeType( 'application/json' );
|
||||
$self->session->response->content_type( 'application/json' );
|
||||
return to_json( { records => \@numbers } );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -486,7 +486,7 @@ sub www_getTaxesAsJson {
|
|||
$results{'startIndex'} = $startIndex;
|
||||
$results{'sort'} = undef;
|
||||
$results{'dir'} = $sortDir;
|
||||
$session->http->setMimeType('application/json');
|
||||
$session->response->content_type('application/json');
|
||||
return JSON::to_json(\%results);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1069,7 +1069,7 @@ sub www_getTransactionsAsJson {
|
|||
$results{'startIndex'} = $startIndex;
|
||||
$results{'sort'} = undef;
|
||||
$results{'dir'} = "desc";
|
||||
$session->http->setMimeType('application/json');
|
||||
$session->response->content_type('application/json');
|
||||
return JSON->new->encode(\%results);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -619,7 +619,7 @@ sub www_payoutDataAsJSON {
|
|||
results => $paginator->getPageData,
|
||||
};
|
||||
|
||||
$session->http->setMimeType( 'application/json' );
|
||||
$session->response->content_type( 'application/json' );
|
||||
|
||||
return JSON::to_json( $data );
|
||||
}
|
||||
|
|
@ -665,7 +665,7 @@ sub www_setPayoutStatus {
|
|||
$item->update({ vendorPayoutStatus => $status });
|
||||
}
|
||||
|
||||
$session->http->setMimeType( 'text/plain' );
|
||||
$session->response->content_type( 'text/plain' );
|
||||
return $status;
|
||||
}
|
||||
|
||||
|
|
@ -745,7 +745,7 @@ sub www_vendorTotalsAsJSON {
|
|||
push @dataset, $dataset;
|
||||
}
|
||||
|
||||
$session->http->setMimeType( 'application/json' );
|
||||
$session->response->content_type( 'application/json' );
|
||||
return JSON::to_json( { vendors => \@dataset } );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue