The user now has the ability to load more gifs | added a menu to the main chat-page to choose between the search tab and the chat list
This commit is contained in:
@@ -12,15 +12,15 @@ export const useTenorStore = defineStore('tenorStore', {
|
||||
|
||||
},
|
||||
actions: {
|
||||
getGifsBySearchTerm(searchTerm : string) {
|
||||
this.loadGifsBySearchTerm(searchTerm).then((response : any) => {
|
||||
getGifsBySearchTerm(searchTerm : string, amount : number) {
|
||||
this.loadGifsBySearchTerm(searchTerm, amount).then((response : any) => {
|
||||
this.gifs = response.data.results;
|
||||
this.gifsLoaded = true;
|
||||
console.log(this.gifsLoaded + " / from store");
|
||||
});
|
||||
},
|
||||
async loadGifsBySearchTerm(searchTerm : string) : Promise<any> {
|
||||
return await api.get("https://tenor.googleapis.com/v2/search?q="+searchTerm+"&key=AIzaSyBXsUPCjnmjXwcdqMLsyhrH1zm_6VYH_fY&client_key=praxistransferProjekt&limit=10");
|
||||
async loadGifsBySearchTerm(searchTerm : string, amount : number) : Promise<any> {
|
||||
return await api.get("https://tenor.googleapis.com/v2/search?q="+searchTerm+"&key=AIzaSyBXsUPCjnmjXwcdqMLsyhrH1zm_6VYH_fY&client_key=praxistransferProjekt&limit="+amount);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -7,6 +7,8 @@ export const useUserStore = defineStore('userStore', {
|
||||
state: () => ({
|
||||
user: {"keycloakID":null,"firstName":null,"lastName":null,"username":null},
|
||||
userLoaded: false,
|
||||
users: [] as ptpUser[],
|
||||
usersLoaded: false,
|
||||
}),
|
||||
getters: {
|
||||
|
||||
@@ -22,5 +24,14 @@ export const useUserStore = defineStore('userStore', {
|
||||
async loadPtpUsersByKeycloakID(keycloakID : string) : Promise<responseModel> {
|
||||
return (await api.get("/users/login/"+keycloakID)).data;
|
||||
},
|
||||
getAllPtpUsers() {
|
||||
this.loadAllPtpUsers().then((response : ptpUser[]) => {
|
||||
this.users = response;
|
||||
this.usersLoaded = true;
|
||||
})
|
||||
},
|
||||
async loadAllPtpUsers() {
|
||||
return (await api.get("/users/user")).data;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user