+
-
+
+
+
+
+
+
{{tenorStore.gifs[0].media_formats.nanogif.url}}
+
Not loaded
+
+
+
+
+
+
+
+
+
+
+
+
+
![Gif]()
+
+
+
+
+
+
+
{{selectedGifURL}}
+
![]()
+
+
+
+
+
+
+
+
@@ -24,15 +68,63 @@
diff --git a/src/stores/tenor-store.ts b/src/stores/tenor-store.ts
new file mode 100644
index 0000000..c97b238
--- /dev/null
+++ b/src/stores/tenor-store.ts
@@ -0,0 +1,26 @@
+import { defineStore } from 'pinia';
+import {api} from 'boot/axios';
+import { ptpUser, responseModel, tenorResponseElement } from 'src/models';
+import Keycloak from 'keycloak-js';
+
+export const useTenorStore = defineStore('tenorStore', {
+ state: () => ({
+ gifs: [] as Array
,
+ gifsLoaded: false,
+ }),
+ getters: {
+
+ },
+ actions: {
+ getGifsBySearchTerm(searchTerm : string) {
+ this.loadGifsBySearchTerm(searchTerm).then((response : any) => {
+ this.gifs = response.data.results;
+ this.gifsLoaded = true;
+ console.log(this.gifsLoaded + " / from store");
+ });
+ },
+ async loadGifsBySearchTerm(searchTerm : string) : Promise {
+ return await api.get("https://tenor.googleapis.com/v2/search?q="+searchTerm+"&key=AIzaSyBXsUPCjnmjXwcdqMLsyhrH1zm_6VYH_fY&client_key=praxistransferProjekt&limit=10");
+ }
+ },
+});