Add application workflow and lead analytics
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { gql } from "@/graphql";
|
||||
|
||||
export const useAnalyticsStore = defineStore("analytics", {
|
||||
state: () => ({ data: null, loading: false, error: null }),
|
||||
actions: {
|
||||
async fetch() {
|
||||
this.loading = true;
|
||||
this.error = null;
|
||||
try {
|
||||
const result = await gql(`query DashboardAnalytics {
|
||||
analytics {
|
||||
totalApplications statusCounts { status count }
|
||||
transitions { from to count }
|
||||
responseCount interviewCount offerCount
|
||||
responseRate interviewRate offerRate
|
||||
averageDaysToResponse averageDaysToInterview averageDaysToOffer
|
||||
}
|
||||
}`);
|
||||
this.data = result.analytics;
|
||||
} catch (error) {
|
||||
this.error = error;
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user