Skip to content

Commit

Permalink
Merge pull request #225 from contentstack/staging
Browse files Browse the repository at this point in the history
Staging to Master merge
  • Loading branch information
cs-raj authored Oct 17, 2024
2 parents 48869fc + 73ab53e commit 80be479
Show file tree
Hide file tree
Showing 7 changed files with 348 additions and 367 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/check-branch.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Check Branch'
name: "Check Branch"

on:
pull_request:
Expand All @@ -8,13 +8,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Comment PR
if: github.base_ref == 'master' && github.head_ref != 'next'
if: github.base_ref == 'master' && github.head_ref != 'staging'
uses: thollander/actions-comment-pull-request@v2
with:
message: |
We regret to inform you that you are currently not able to merge your changes into the master branch due to restrictions applied by our SRE team. To proceed with merging your changes, we kindly request that you create a pull request from the next branch. Our team will then review the changes and work with you to ensure a successful merge into the master branch.
We regret to inform you that you are currently not able to merge your changes into the master branch due to restrictions applied by our SRE team. To proceed with merging your changes, we kindly request that you create a pull request from the staging branch. Our team will then review the changes and work with you to ensure a successful merge into the master branch.
- name: Check branch
if: github.base_ref == 'master' && github.head_ref != 'next'
if: github.base_ref == 'master' && github.head_ref != 'staging'
run: |
echo "ERROR: We regret to inform you that you are currently not able to merge your changes into the master branch due to restrictions applied by our SRE team. To proceed with merging your changes, we kindly request that you create a pull request from the next branch. Our team will then review the changes and work with you to ensure a successful merge into the master branch."
echo "ERROR: We regret to inform you that you are currently not able to merge your changes into the master branch due to restrictions applied by our SRE team. To proceed with merging your changes, we kindly request that you create a pull request from the staging branch. Our team will then review the changes and work with you to ensure a successful merge into the master branch."
exit 1
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ tap-html.html
coverage
.env
.dccache
dist/*
dist/*
*.log
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,14 @@ To get a single entry, you need to specify the content type as well as the ID of
```javascript
const Query = Stack.ContentType('blog').Entry("<entry_uid>");

Query.fetch()
.then(function success(entry) {
console.log(entry.get('title')); // Retrieve field value by providing a field's uid
console.log(entry.toJSON()); // Convert the entry result object to JSON
}, function error(err) {
// err object
})
Query
.toJSON()
.fetch()
.then(function success(entry) {
console.log(entry.get('title')); // Retrieve field value by providing a field's uid
}, function error(err) {
// err object
})
```

To retrieve multiple entries of a content type, you need to specify the content type uid. You can also specify search parameters to filter results.
Expand All @@ -151,19 +152,19 @@ To retrieve multiple entries of a content type, you need to specify the content
const Query = Stack.ContentType('blog').Query();

Query
.where("title", "welcome")
.includeContentType()
.includeCount()
.toJSON()
.find()
.then(function success(result) {
// result is array where -
// result[0] =&gt; entry objects
// result[result.length-1] =&gt; entry objects count included only when .includeCount() is queried.
// result[1] =&gt; schema of the content type is included when .includeContentType() is queried.
}, function error(err) {
// err object
})
.where("title", "welcome")
.includeContentType()
.includeCount()
.toJSON()
.find()
.then(function success(result) {
// result is array where -
// result[0] =&gt; entry objects
// result[result.length-1] =&gt; entry objects count included only when .includeCount() is queried.
// result[1] =&gt; schema of the content type is included when .includeContentType() is queried.
}, function error(err) {
// err object
})
```

#### Cache Policies
Expand Down
Loading

0 comments on commit 80be479

Please sign in to comment.