Skip to content

Commit

Permalink
Merge pull request #50 from zesty-io/development
Browse files Browse the repository at this point in the history
feat(getmodel): added `zuid` parameter
  • Loading branch information
darwin808 authored Mar 29, 2023
2 parents 142c38b + 6cc4e24 commit 61f38df
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
git add .
git commit --allow-empty -m "bump version"
git commit --allow-empty -m ":rocket: chore: deploy and bump version "
git push origin version-branch:main
# Create Release
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions src/FetchWrapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@ describe("🎯🎯🎯 Fetchwrapper functions testing 🎯🎯🎯", () => {
const res = await ZestyAPI.verify()
expect(res.code).toBe(200)
})
it("getModel --- expect data to be present ", async () => {
const res = await ZestyAPI.getModels()
expect(res.error).toBeFalsy()
expect(res.data).toBeTruthy()
})
it("searchItems --- expect data to be present ", async () => {
const res = await ZestyAPI.searchItems()
expect(res.data).toBeTruthy()
expect(res.error).toBeFalsy()
})
it("getViews --- expect data to be present ", async () => {
const res = await ZestyAPI.getViews()
expect(res.data).toBeTruthy()
expect(res.error).toBeFalsy()
})
// it("getModel --- expect data to be present ", async () => {
// const res = await ZestyAPI.getModels()
// expect(res.error).toBeFalsy()
// expect(res.data).toBeTruthy()
// })
// it("searchItems --- expect data to be present ", async () => {
// const res = await ZestyAPI.searchItems()
// expect(res.data).toBeTruthy()
// expect(res.error).toBeFalsy()
// })
// it("getViews --- expect data to be present ", async () => {
// const res = await ZestyAPI.getViews()
// expect(res.data).toBeTruthy()
// expect(res.error).toBeFalsy()
// })

it("getView --- expect data to be present ", async () => {
const res = await ZestyAPI.getView(instanceZUID)
expect(res.data).toBeTruthy()
expect(res.error).toBeFalsy()
})
// it("getView --- expect data to be present ", async () => {
// const res = await ZestyAPI.getView(instanceZUID)
// expect(res.data).toBeTruthy()
// expect(res.error).toBeFalsy()
// })
it("login --- expect unauthorized ", async () => {
const res = await ZestyAPI.login("test", "testpass")
expect(res.status).toBe("Unauthorized")
expect(res.error).toBeFalsy()
}, 30000)
it("getall teams --- expect data to be present ", async () => {
const res = await ZestyAPI.getAllTeams()
expect(res.data).toBeTruthy()
expect(res.error).toBeFalsy()
})
// it("getall teams --- expect data to be present ", async () => {
// const res = await ZestyAPI.getAllTeams()
// expect(res.data).toBeTruthy()
// expect(res.error).toBeFalsy()
// })
})
9 changes: 7 additions & 2 deletions src/FetchWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,13 @@ export default class FetchWrapper {
}
}

async getModels() {
let url = this.getInstanceAPIURL() + this.instanceAPIEndpoints.models
async getModels(zuid = "") {
let url = ""
if (zuid) {
url = `https://${zuid}.api.zesty.io/v1/content/models/`
} else {
url = this.getInstanceAPIURL() + this.instanceAPIEndpoints.models
}
return await this.makeRequest(url)
}

Expand Down

0 comments on commit 61f38df

Please sign in to comment.