Skip to content

Commit

Permalink
apply reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienMattiussi committed Oct 19, 2023
1 parent b1fbe1e commit 511d3c4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 94 deletions.
11 changes: 2 additions & 9 deletions src/api/controller/api/precomputed.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,10 @@ export const postPrecomputed = async ctx => {
};

export const putPrecomputed = async (ctx, id) => {
const newResource = ctx.request.body;
const newPrecomputed = ctx.request.body;

try {
// Delete existing data from dataset
// If we change the name or the rule, existing data is obsolete
const precomputed = await ctx.precomputed.findOneById(id);
await ctx.dataset.removeAttribute(precomputed.name);

ctx.body = await ctx.precomputed.update(id, newResource);
ctx.body = await ctx.precomputed.update(id, newPrecomputed);
} catch (error) {
ctx.status = 403;
ctx.body = { error: error.message };
Expand All @@ -57,7 +52,6 @@ export const putPrecomputed = async (ctx, id) => {

export const deletePrecomputed = async (ctx, id) => {
try {
const precomputed = await ctx.precomputed.findOneById(id);
const activeJob = await getActiveJob(ctx.tenant);
if (
activeJob?.data?.jobType === PRECOMPUTER &&
Expand All @@ -66,7 +60,6 @@ export const deletePrecomputed = async (ctx, id) => {
cancelJob(ctx, PRECOMPUTER);
}
await ctx.precomputed.delete(id);
await ctx.dataset.removeAttribute(precomputed.name);
ctx.status = 200;
ctx.body = { message: 'ok' };
} catch (error) {
Expand Down
51 changes: 0 additions & 51 deletions src/api/services/precomputed/directPathMultipleValues.txt

This file was deleted.

34 changes: 0 additions & 34 deletions src/api/services/precomputed/directPathSingleValue.txt

This file was deleted.

0 comments on commit 511d3c4

Please sign in to comment.