Merge pull request #30 from fLotte-meets-HWR-DB/develop

Develop
pull/31/head^2
Trivernis 4 years ago committed by GitHub
commit 52ad02ef5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

1250
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -15,17 +15,17 @@
"devDependencies": {
"@types/crc": "^3.4.0",
"@types/mocha-steps": "^1.3.0",
"@types/node": "^14.10.0",
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.1.0",
"@types/node": "^14.14.10",
"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"chai": "^4.2.0",
"delete": "^1.1.0",
"eslint": "^7.8.1",
"eslint": "^7.14.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-standard": "^4.1.0",
"gulp": "^4.0.2",
"gulp-eslint": "^6.0.0",
"gulp-nodemon": "^2.5.0",
@ -33,14 +33,14 @@
"mocha": "^8.2.1",
"mocha-steps": "^1.3.0",
"nyc": "^15.1.0",
"ts-node": "^9.0.0",
"typescript": "^4.0.2"
"ts-node": "^9.1.0",
"typescript": "^4.1.2"
},
"dependencies": {
"@types/chai": "^4.2.14",
"@types/chai-http": "^4.2.0",
"@types/mocha": "^8.0.4",
"apollo-server-express": "^2.17.0",
"apollo-server-express": "^2.19.0",
"body-parser": "^1.19.0",
"chai-http": "^4.3.0",
"cors": "^2.8.5",
@ -48,11 +48,11 @@
"dotenv": "^8.2.0",
"express": "^4.17.1",
"express-cors": "0.0.3",
"graphql": "^15.3.0",
"graphql": "^15.4.0",
"messagepack": "^1.1.12",
"pg": "^8.3.3",
"pg": "^8.5.1",
"promise-socket": "^7.0.0",
"reflect-metadata": "^0.1.13",
"typeorm": "^0.2.26"
"typeorm": "^0.2.29"
}
}

@ -25,6 +25,7 @@ import { LendingStation } from '../../model/LendingStation';
import { TimeFrame } from '../../model/TimeFrame';
import { ActionLogger, genDateRange, DBUtils, LockUtils } from './utils';
import { ResourceLockedError } from '../../errors/ResourceLockedError';
import { NotFoundError } from '../../errors/NotFoundError';
export class LendingStationAPI extends DataSource {
connection : Connection
@ -247,7 +248,7 @@ export class LendingStationAPI extends DataSource {
.set({ ...timeFrame })
.where('id = :id', { id: timeFrame.id })
.execute()
.then(value => { if (value.affected !== 1) { throw new UserInputError('ID not found'); } });
.then(value => { if (value.affected !== 1) { throw new NotFoundError('TimeFrame', 'id', timeFrame.id); } });
});
!keepLock && await this.unlockTimeFrame(timeFrame.id, userId);
return this.timeFrameById(timeFrame.id);

@ -179,15 +179,17 @@ export class ProviderAPI extends DataSource {
}
async createOrganisation (organisation: any) {
let inserts: any = null;
let createdOrganisation: any = null;
await this.connection.transaction(async (entityManager: EntityManager) => {
inserts = await entityManager.getRepository(Organisation)
const result = await entityManager.getRepository(Organisation)
.createQueryBuilder('o')
.insert()
.values([organisation])
.execute();
createdOrganisation = await entityManager.getRepository(Organisation).findOne(result.identifiers[0].id);
});
return inserts.generatedMaps[0];
return createdOrganisation;
}
async lockOrganisation (id: number, userId: number) {

@ -840,7 +840,7 @@ export default gql`
address: AddressCreateInput!
name: String!
"registration number of association"
associationNo: String!
associationNo: String
"If Club, at what court registered"
registeredAt: String
contactInformationId: ID

Loading…
Cancel
Save