Files
openobserve/web/src/composables/useFunctions.ts
T
Prabhat Sharma 1b3aec6911 docs: update license in other missing files (#2062)
update license in other missing files to AGPL
2023-11-27 19:50:14 -08:00

50 lines
1.4 KiB
TypeScript

// Copyright 2023 Zinc Labs Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import { useQuasar } from "quasar";
import { useStore } from "vuex";
import TransformService from "@/services/jstransform";
const useFunctions = () => {
const store = useStore();
const $q = useQuasar();
const getAllFunctions = async () => {
try {
return await TransformService.list(
1,
100000,
"name",
false,
"",
store.state.selectedOrganization.identifier
)
.then((res: any) => {
store.dispatch("setFunctions", res.data.list);
return;
})
.catch((e: any) => {
throw new Error(e.message);
});
} catch (e: any) {
throw new Error(e.message);
}
};
return { getAllFunctions };
};
export default useFunctions;