Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
mwangggg committed Jan 16, 2024
1 parent 23a20b2 commit 54c6456
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/app/Shared/Services/Api.service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export class ApiService {

const headers = {};
headers['Content-Type'] = 'application/json';
return this.sendLegacyRequest('v2', 'rules', 'Rule', {
return this.sendLegacyRequest('v2', 'rules', 'Rule Upload Failed', {
method: 'POST',
body: JSON.stringify(rule),
headers: headers,
Expand Down Expand Up @@ -572,7 +572,7 @@ export class ApiService {

const body = new window.FormData();
body.append('template', file);
return this.sendLegacyRequest('v1', 'templates', 'Template', {
return this.sendLegacyRequest('v1', 'templates', 'Template Upload Failed', {
body: body,
method: 'POST',
headers: {},
Expand Down Expand Up @@ -641,7 +641,7 @@ export class ApiService {

const body = new window.FormData();
body.append('probeTemplate', file);
return this.sendLegacyRequest('v2', `probes/${file.name}`, 'Custom Probe Template', {
return this.sendLegacyRequest('v2', `probes/${file.name}`, 'Custom Probe Template Upload Failed', {
method: 'POST',
body: body,
headers: {},
Expand Down Expand Up @@ -839,7 +839,7 @@ export class ApiService {
body.append('recording', file);
body.append('labels', JSON.stringify(labels));

return this.sendLegacyRequest('v1', 'recordings', 'Recording', {
return this.sendLegacyRequest('v1', 'recordings', 'Recording Upload Failed', {
method: 'POST',
body: body,
headers: {},
Expand Down Expand Up @@ -873,7 +873,7 @@ export class ApiService {

const body = new window.FormData();
body.append('cert', file);
return this.sendLegacyRequest('v2', 'certificates', 'Certificate', {
return this.sendLegacyRequest('v2', 'certificates', 'Certificate Upload Failed', {
method: 'POST',
body,
headers: {},
Expand Down Expand Up @@ -1454,9 +1454,9 @@ export class ApiService {
if (!suppressNotifications) {
try {
const body = JSON.parse(detail).data.reason;
this.notifications.danger(`${title} Upload Failed`, body);
this.notifications.danger(`${title}`, body);
} catch {
this.notifications.danger(`${title} Upload Failed`, detail);
this.notifications.danger(`${title}`, detail);
}
}
});
Expand Down

0 comments on commit 54c6456

Please sign in to comment.