Skip to content
Snippets Groups Projects
Commit d5b82431 authored by stevereis's avatar stevereis
Browse files

refactor: Add enum to check mime types results

parent 2a82e66b
No related branches found
No related tags found
No related merge requests found
export type Dictionary<T> = { [key: string]: T }; export type Dictionary<T> = { [key: string]: T };
export enum MIME_TYPES {
ERROR = 'text/plain+error',
WARNING = 'text/plain+warning',
USER_WARNING = 'text/plain+user_error',
HIGHCHARTS = 'application/vnd.highcharts+json',
JSON = 'application/json',
JSONBTREE = 'application/binary-tree+json',
PFA = 'application/pfa+json',
JSONDATA = 'application/vnd.dataresource+json',
HTML = 'text/html',
TEXT = 'text/plain',
}
import { MIME_TYPES } from 'src/common/interfaces/utilities.interface';
import { Category } from 'src/engine/models/category.model'; import { Category } from 'src/engine/models/category.model';
import { Dataset } from 'src/engine/models/dataset.model'; import { Dataset } from 'src/engine/models/dataset.model';
import { Algorithm } from 'src/engine/models/experiment/algorithm.model'; import { Algorithm } from 'src/engine/models/experiment/algorithm.model';
...@@ -245,7 +246,7 @@ export const dataToRaw = ( ...@@ -245,7 +246,7 @@ export const dataToRaw = (
let data = result; let data = result;
if (algo === 'CART') { if (algo === 'CART') {
data = { ...data, type: 'application/binary-tree+json' }; data = { ...data, type: MIME_TYPES.JSONBTREE };
} }
return [ return [
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment