Change getMimeType and setMimeType to response->content_type.

This commit is contained in:
Colin Kuskie 2010-11-21 22:35:26 -08:00
parent e5adc07a05
commit fd8f03a186
52 changed files with 138 additions and 175 deletions

View file

@ -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;
}

View file

@ -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';
}

View file

@ -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

View file

@ -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 } );
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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 } );
}