You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/docker/services/webhooks/getWebhooks.ts

20 lines
548 B

import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { buildUrl } from './build-url';
import { Webhook } from './types';
export async function getWebhooks(
environmentId: EnvironmentId,
serviceId: string
) {
try {
const { data } = await axios.get<Array<Webhook>>(buildUrl(), {
params: { filters: { EndpointID: environmentId, ResourceID: serviceId } },
});
return data;
} catch (error) {
throw parseAxiosError(error);
}
}