Skip to content

Commit

Permalink
Add .model to cds.context
Browse files Browse the repository at this point in the history
  • Loading branch information
daogrady committed Aug 22, 2024
1 parent 46ca76a commit 86b93dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion apis/events.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Definition } from './linked'
import { Definition, LinkedCSN } from './linked'
import { Query } from './cqn'
import { ref } from './cqn'
import * as express from 'express'
Expand All @@ -25,6 +25,8 @@ export class EventContext {

features?: { [key: string]: boolean }

model: LinkedCSN

}

/**
Expand Down
4 changes: 3 additions & 1 deletion test/typescript/apis/project/cds-linked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,6 @@ cds.linked.classes.Association === cds.Association
cds.linked.classes.Association === cds.linked.classes.event

// but make sure we can still call .linked(CSN)
const ln: LinkedCSN = cds.linked({})
const ln: LinkedCSN = cds.linked({})

const ln2: LinkedCSN | undefined = cds.context?.model

0 comments on commit 86b93dc

Please sign in to comment.