Skip to content

Commit faf82f8

Browse files
authored
Merge pull request #3182 from SeedCompany/no-session
2 parents 693828a + bcc85a4 commit faf82f8

File tree

54 files changed

+101
-226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+101
-226
lines changed

src/components/authentication/authentication.repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export class AuthenticationRepository {
224224
const result = await this.db
225225
.query()
226226
.match([
227-
node('requestingUser', 'User', { id: session.userId }),
227+
requestingUser(session),
228228
relation('out', '', 'password', ACTIVE),
229229
node('password', 'Property'),
230230
])

src/components/budget/budget.repository.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
createRelationships,
2020
matchChangesetAndChangedProps,
2121
matchPropsAndProjectSensAndScopedRoles,
22-
matchRequestingUser,
2322
merge,
2423
oncePerProject,
2524
paginate,
@@ -46,11 +45,7 @@ export class BudgetRepository extends DtoRepository<
4645
super();
4746
}
4847

49-
async create(
50-
input: CreateBudget,
51-
universalTemplateFileId: FileId,
52-
session: Session,
53-
) {
48+
async create(input: CreateBudget, universalTemplateFileId: FileId) {
5449
const initialProps = {
5550
status: Status.Pending,
5651
universalTemplateFile: universalTemplateFileId,
@@ -59,7 +54,6 @@ export class BudgetRepository extends DtoRepository<
5954

6055
const result = await this.db
6156
.query()
62-
.apply(matchRequestingUser(session))
6357
.apply(await createNode(Budget, { initialProps }))
6458
.apply(
6559
createRelationships(Budget, 'in', {

src/components/budget/budget.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export class BudgetService {
5454
const budgetId = await this.budgetRepo.create(
5555
{ projectId, ...input },
5656
universalTemplateFileId,
57-
session,
5857
);
5958

6059
this.logger.debug(`Created Budget`, {

src/components/ceremony/ceremony.repository.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
ACTIVE,
88
createNode,
99
matchPropsAndProjectSensAndScopedRoles,
10-
matchRequestingUser,
1110
oncePerProject,
1211
paginate,
1312
requestingUser,
@@ -25,7 +24,7 @@ export class CeremonyRepository extends DtoRepository<
2524
typeof Ceremony,
2625
[session: Session]
2726
>(Ceremony) {
28-
async create(input: CreateCeremony, session: Session) {
27+
async create(input: CreateCeremony) {
2928
const initialProps = {
3029
type: input.type,
3130
planned: input.planned,
@@ -35,7 +34,6 @@ export class CeremonyRepository extends DtoRepository<
3534
};
3635
return await this.db
3736
.query()
38-
.apply(matchRequestingUser(session))
3937
.apply(await createNode(Ceremony, { initialProps }))
4038
.return<{ id: ID }>('node.id as id')
4139
.first();

src/components/ceremony/ceremony.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export class CeremonyService {
2727
@Logger('ceremony:service') private readonly logger: ILogger,
2828
) {}
2929

30-
async create(input: CreateCeremony, session: Session): Promise<ID> {
30+
async create(input: CreateCeremony): Promise<ID> {
3131
try {
32-
const result = await this.ceremonyRepo.create(input, session);
32+
const result = await this.ceremonyRepo.create(input);
3333

3434
if (!result) {
3535
throw new ServerException('failed to create a ceremony');

src/components/ceremony/handlers/create-engagement-default-ceremony.handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ export class CreateEngagementDefaultCeremonyHandler
1515
) {}
1616

1717
async handle(event: EngagementCreatedEvent) {
18-
const { engagement, session } = event;
18+
const { engagement } = event;
1919
const input = {
2020
type:
2121
engagement.__typename === 'LanguageEngagement'
2222
? CeremonyType.Dedication
2323
: CeremonyType.Certification,
2424
};
25-
const ceremonyId = await this.ceremonies.create(input, session);
25+
const ceremonyId = await this.ceremonies.create(input);
2626

2727
// connect ceremonyId to engagement
2828
await this.db

src/components/changeset/changeset.repository.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import {
88
or,
99
relation,
1010
} from 'cypher-query-builder';
11-
import { ID, NotFoundException, Session } from '../../common';
11+
import { ID, NotFoundException } from '../../common';
1212
import { DtoRepository } from '../../core';
1313
import { ACTIVE, path, variable } from '../../core/database/query';
1414
import { BaseNode } from '../../core/database/results';
1515
import { Changeset, ChangesetDiff } from './dto';
1616

1717
@Injectable()
1818
export class ChangesetRepository extends DtoRepository(Changeset) {
19-
async difference(id: ID, _session: Session, parent?: ID) {
19+
async difference(id: ID, parent?: ID) {
2020
const importVars = ['changeset', ...(parent ? ['parent'] : [])];
2121
const limitToParentSubTree = parent
2222
? {

src/components/changeset/changeset.resolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class ChangesetResolver {
3131
})
3232
parent?: ID,
3333
): Promise<ChangesetDiff> {
34-
const diff = await this.repo.difference(changeset.id, session, parent);
34+
const diff = await this.repo.difference(changeset.id, parent);
3535
const load = (node: BaseNode, view?: ObjectView) =>
3636
this.resources.loadByBaseNode(node, view ?? { changeset: changeset.id });
3737
const [added, removed, changed] = await Promise.all([

src/components/ethno-art/ethno-art.repository.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Injectable } from '@nestjs/common';
22
import { Query } from 'cypher-query-builder';
33
import { ChangesOf } from '~/core/database/changes';
4-
import { ID, Session } from '../../common';
4+
import { ID } from '../../common';
55
import { DbTypeOf, DtoRepository } from '../../core';
66
import {
77
createNode,
@@ -23,7 +23,7 @@ export class EthnoArtRepository extends DtoRepository(EthnoArt) {
2323
constructor(private readonly scriptureRefs: ScriptureReferenceRepository) {
2424
super();
2525
}
26-
async create(input: CreateEthnoArt, _session: Session) {
26+
async create(input: CreateEthnoArt) {
2727
const initialProps = {
2828
name: input.name,
2929
canDelete: true,
@@ -45,7 +45,7 @@ export class EthnoArtRepository extends DtoRepository(EthnoArt) {
4545
await this.updateProperties(existing, simpleChanges);
4646
}
4747

48-
async list(input: EthnoArtListInput, _session: Session) {
48+
async list(input: EthnoArtListInput) {
4949
const result = await this.db
5050
.query()
5151
.matchNode('node', 'EthnoArt')

src/components/ethno-art/ethno-art.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class EthnoArtService {
3838
}
3939

4040
try {
41-
const result = await this.repo.create(input, session);
41+
const result = await this.repo.create(input);
4242

4343
if (!result) {
4444
throw new ServerException('Failed to create ethno art');
@@ -127,7 +127,7 @@ export class EthnoArtService {
127127
async list(input: EthnoArtListInput, session: Session) {
128128
// -- don't need a check for canList. all roles are allowed to see at least one prop,
129129
// and this isn't a sensitive component.
130-
const results = await this.repo.list(input, session);
130+
const results = await this.repo.list(input);
131131
return await mapListResults(results, (dto) => this.secure(dto, session));
132132
}
133133
}

0 commit comments

Comments
 (0)