Merge pull request #33 from fLotte-meets-HWR-DB/bug

Bug
main
leonnicolas 4 years ago committed by GitHub
commit 4b11ce46ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -145,6 +145,14 @@ export class ProviderAPI extends DataSource {
} }
async updateProvider (provider: any, userId: number) { async updateProvider (provider: any, userId: number) {
// make sure that a provider cannot have both organisation and person at the same time
if (provider.privatePersonId && provider.organisationId) { return new UserInputError('Provider must have either privatePersonId or organisationId'); }
if (provider.privatePersonId) {
provider.organisationId = null;
} else if (provider.organisationId) {
provider.privatePersonId = null;
}
const keepLock = provider.keepLock; const keepLock = provider.keepLock;
delete provider.keepLock; delete provider.keepLock;
const cargoBikes = provider.cargoBikeIds; const cargoBikes = provider.cargoBikeIds;

@ -52,7 +52,7 @@ export class Provider implements Lockable {
id: number; id: number;
@Column({ @Column({
nullable: false nullable: true
}) })
formName: String; formName: String;

@ -88,6 +88,9 @@ export default {
throw new PermissionError(); throw new PermissionError();
} }
}, },
distributedActiveBikeParte: () => {
return false;
},
isLockedByMe: (parent: any, __: any, { req }: { req: any }) => isLockedByMe(parent, { req }), isLockedByMe: (parent: any, __: any, { req }: { req: any }) => isLockedByMe(parent, { req }),
isLocked: (parent: any, __: any, { req }: { req: any }) => isLocked(parent, { req }) isLocked: (parent: any, __: any, { req }: { req: any }) => isLocked(parent, { req })
}, },

@ -422,6 +422,7 @@ export default gql`
This value is calculated form other values. This value is calculated form other values.
It is true, if the person is not on the black list and not retired It is true, if the person is not on the black list and not retired
and is either Mentor dt. Pate or Partner Mentor dt. Partnerpate for at least one bike. and is either Mentor dt. Pate or Partner Mentor dt. Partnerpate for at least one bike.
Note: this will always be false for the moment.
""" """
distributedActiveBikeParte: Boolean! distributedActiveBikeParte: Boolean!
engagement: [Engagement] engagement: [Engagement]

Loading…
Cancel
Save