nopaque/app/static/js/requests/contributions.js

59 lines
2.4 KiB
JavaScript
Raw Normal View History

2023-10-04 10:32:27 +00:00
/*****************************************************************************
* Requests for /contributions routes *
*****************************************************************************/
nopaque.requests.contributions = {};
2023-10-04 10:32:27 +00:00
/*****************************************************************************
* Requests for /contributions/spacy-nlp-pipeline-models routes *
*****************************************************************************/
nopaque.requests.contributions.spacy_nlp_pipeline_models = {};
2023-10-04 10:32:27 +00:00
nopaque.requests.contributions.spacy_nlp_pipeline_models.entity = {};
2023-10-04 10:32:27 +00:00
nopaque.requests.contributions.spacy_nlp_pipeline_models.entity.delete = (spacyNlpPipelineModelId) => {
2023-10-04 10:32:27 +00:00
let input = `/contributions/spacy-nlp-pipeline-models/${spacyNlpPipelineModelId}`;
let init = {
method: 'DELETE'
};
return nopaque.requests.JSONfetch(input, init);
2023-10-04 10:32:27 +00:00
};
nopaque.requests.contributions.spacy_nlp_pipeline_models.entity.isPublic = {};
2023-10-04 10:32:27 +00:00
nopaque.requests.contributions.spacy_nlp_pipeline_models.entity.isPublic.update = (spacyNlpPipelineModelId, value) => {
2023-10-04 10:32:27 +00:00
let input = `/contributions/spacy-nlp-pipeline-models/${spacyNlpPipelineModelId}/is_public`;
let init = {
method: 'PUT',
body: JSON.stringify(value)
};
return nopaque.requests.JSONfetch(input, init);
2023-10-04 10:32:27 +00:00
};
/*****************************************************************************
* Requests for /contributions/tesseract-ocr-pipeline-models routes *
*****************************************************************************/
nopaque.requests.contributions.tesseract_ocr_pipeline_models = {};
2023-10-04 10:32:27 +00:00
nopaque.requests.contributions.tesseract_ocr_pipeline_models.entity = {};
2023-10-04 10:32:27 +00:00
nopaque.requests.contributions.tesseract_ocr_pipeline_models.entity.delete = (tesseractOcrPipelineModelId) => {
2023-10-04 10:32:27 +00:00
let input = `/contributions/tesseract-ocr-pipeline-models/${tesseractOcrPipelineModelId}`;
let init = {
method: 'DELETE'
};
return nopaque.requests.JSONfetch(input, init);
2023-10-04 10:32:27 +00:00
};
nopaque.requests.contributions.tesseract_ocr_pipeline_models.entity.isPublic = {};
2023-10-04 10:32:27 +00:00
nopaque.requests.contributions.tesseract_ocr_pipeline_models.entity.isPublic.update = (tesseractOcrPipelineModelId, value) => {
2023-10-04 10:32:27 +00:00
let input = `/contributions/tesseract-ocr-pipeline-models/${tesseractOcrPipelineModelId}/is_public`;
let init = {
method: 'PUT',
body: JSON.stringify(value)
};
return nopaque.requests.JSONfetch(input, init);
2023-10-04 10:32:27 +00:00
};