Skip to content

Commit

Permalink
Publish v1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
duydvu committed Dec 27, 2022
1 parent c02a2cc commit 304a735
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ Operator | Description
--- | ---
`ASUM(a, b)` | Aggregated sum of O2M field. For example: calculate shopping cart total price with `ASUM(products, MULTIPLY(price, quantity))` where `products` is the O2M field in the shopping cart and `price` & `quantity` are 2 fields of `products`.

### Condition

Operator | Description
--- | ---
`IF(A, B, C)` | return `B` if `A` is `true`, otherwise `C`

## Dynamic Variables

There are 2 dynamic variables available that you can use in the expressions:
- `$NOW`: return the current Date object. Example: `{{ YEAR($NOW) }}` returns the current year.
- `$CURRENT_USER`: return the current user's id. Example: `{{ EQUAL($CURRENT_USER, user) }}` checks if the `user` field is the current user.


# Limitation
- Cannot parse literal strings (`{{ 's' }}`).
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "directus-extension-computed-interface",
"version": "1.3.0",
"version": "1.4.0",
"description": "Perform computed value based on other fields",
"author": {
"email": "duydvu98@gmail.com",
Expand Down

0 comments on commit 304a735

Please sign in to comment.