Skip to content

Commit

Permalink
update to types
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKriegler committed Jan 29, 2020
1 parent eb6e766 commit 845d9a7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions lib/common/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ export function deepClone<T>(obj: T): T {
export function withCb<T>(fn: (cb: (err: any, ret?: T) => void) => void): Promise<T> {
return new Promise<T>((resolve, reject) => fn((err, ret) => {
if (err) {
reject(err);
return;
return reject(err);
}
resolve(ret);
return resolve(ret);
}));
}

Expand All @@ -29,7 +28,6 @@ export async function runRequest<T>(res: Response, fn: () => Promise<T>) {
message,
status
}
console.error(e)
return res.status(statusCode).json(error);
}
}
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as http from 'http';

import debug from 'debug';
import Server from './server';
import Server from '@matilda/src/server';

const port = normalizePort(process.env.PORT || 3000);
Server.set('port', port);
Expand Down
4 changes: 2 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { configureMongoStores } from '@matilda/lib/common';
import express from 'express';
import logger from 'morgan';

import HealthController from './controllers/HealthController';
import TaskController from './controllers/TaskController';
import HealthController from '@matilda/src/controllers/HealthController';
import TaskController from '@matilda/src/controllers/TaskController';

const baseRoute = `/${config.api.base}/${config.api.version}`;

Expand Down
2 changes: 1 addition & 1 deletion src/states/base/TaskState.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TaskData, TaskStatus, TaskType, TaskStatuses } from '@matilda/src/types';
import { ITaskStateParent, TASK_STATE_CONSTRUCTORS } from '../index';

// Needed as opposed to normal construct as the task does not exist yet
// Needed as opposed to normal construct as the task does not exist yet
export function constructCreateTaskState(
parent: ITaskStateParent,
type: TaskType
Expand Down

0 comments on commit 845d9a7

Please sign in to comment.