vue-contentful-hook
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -0,1 +1,8 @@ | ||
## [1.3.0](https://github.com/lbenie/vue-contentful-hook/compare/v1.2.0...v1.3.0) (2022-03-21) | ||
### :sparkles: Features | ||
* use axios for ssr ([9bb183b](https://github.com/lbenie/vue-contentful-hook/commit/9bb183b9583ff7b1cc1c43fdcb594c0db7210acd)) | ||
## [1.2.0](https://github.com/lbenie/vue-contentful-hook/compare/v1.1.0...v1.2.0) (2022-03-18) | ||
@@ -2,0 +9,0 @@ |
import { ref } from "vue"; | ||
import axios from "axios"; | ||
var useContentful = function(query, _a) { | ||
@@ -8,4 +9,3 @@ var spaceId = _a.spaceId, token = _a.token; | ||
var URI = "https://graphql.contentful.com/content/v1/spaces/".concat(spaceId); | ||
var options = { | ||
method: "POST", | ||
axios.post(URI, { | ||
headers: { | ||
@@ -16,6 +16,6 @@ Authorization: "Bearer ".concat(token), | ||
body: JSON.stringify({ query }) | ||
}; | ||
fetch(URI, options).then(function(response) { | ||
return response.json(); | ||
}).then(function(_a2) { | ||
var data2 = _a2.data; | ||
return data2; | ||
}).then(function(_a2) { | ||
var response = _a2.data, contenfulErrors = _a2.errors; | ||
@@ -22,0 +22,0 @@ isLoading.value = false; |
@@ -1,1 +0,1 @@ | ||
(function(e,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(e=typeof globalThis!="undefined"?globalThis:e||self,n(e["vue-contentful-hook"]={},e.vue))})(this,function(e,n){"use strict";var s=function(c,r){var d=r.spaceId,l=r.token,u=n.ref(),o=n.ref(),i=n.ref(!0),p="https://graphql.contentful.com/content/v1/spaces/".concat(d),v={method:"POST",headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"},body:JSON.stringify({query:c})};return fetch(p,v).then(function(t){return t.json()}).then(function(t){var f=t.data,a=t.errors;i.value=!1,f&&(u.value=f),a&&(o.value=a)}).catch(function(t){o.value=[String(t)]}),{data:u,errors:o,isLoading:i}};e.useContentful=s,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"}); | ||
(function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","axios"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e["vue-contentful-hook"]={},e.vue,e.axios))})(this,function(e,t,c){"use strict";function d(n){return n&&typeof n=="object"&&"default"in n?n:{default:n}}var l=d(c),p=function(n,u){var v=u.spaceId,h=u.token,i=t.ref(),a=t.ref(),f=t.ref(!0),y="https://graphql.contentful.com/content/v1/spaces/".concat(v);return l.default.post(y,{headers:{Authorization:"Bearer ".concat(h),"Content-Type":"application/json"},body:JSON.stringify({query:n})}).then(function(o){var r=o.data;return r}).then(function(o){var r=o.data,s=o.errors;f.value=!1,r&&(i.value=r),s&&(a.value=s)}).catch(function(o){a.value=[String(o)]}),{data:i,errors:a,isLoading:f}};e.useContentful=p,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"}); |
{ | ||
"name": "vue-contentful-hook", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "A vue hook to fetch contentful data using GraphQL query", | ||
@@ -50,2 +50,3 @@ "repository": { | ||
"all-contributors-cli": "6.20.0", | ||
"axios": "^0.26.1", | ||
"concurrently": "7.0.0", | ||
@@ -70,4 +71,5 @@ "conventional-changelog-conventionalcommits": "4.6.3", | ||
"peerDependencies": { | ||
"axios": "^0.26.1", | ||
"vue": "^3.2.29" | ||
} | ||
} |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
15008
0
2
29