diff --git a/package.json b/package.json index 460d24f..1e333b4 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "luxon": "^3.1.0", "vue": "^3.2.13", "vue-router": "^4.0.3", + "vuedraggable": "^4.1.0", "vuex": "^4.0.0" }, "devDependencies": { diff --git a/src/api/types.ts b/src/api/types.ts index 095d517..6118934 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -7,17 +7,17 @@ export enum Privileges { } export interface Tag { - CreatedAt: string; - DeletedAt: string; + createdAt: string; + deletedAt: string; ID: number; - UpdatedAt: string; + updatedAt: string; description: string; active: boolean; contribution: number; } export interface Contribution { - CreatedAt: string; + createdAt: string; amount: number; rewardFundID: number; tags: Tag[]; @@ -122,6 +122,14 @@ export interface AuthenticationRequest { export interface LoginResponse { token: string | null; +} // TODO: change shape of fund creation request + +export interface GetQueueMembersRequest { + id: number; +} + +export interface GetQueueMembersResponse { + members: RewardFund[]; } export interface GetRewardFundsRequest { diff --git a/src/views/AddFundView.vue b/src/views/AddFundView.vue index 14cedab..a8e23b9 100644 --- a/src/views/AddFundView.vue +++ b/src/views/AddFundView.vue @@ -54,14 +54,14 @@ aria-label="Queue Selection" ref="queueOptions" > + -
+
+
+ + > + +
{{ queue.title }}
+
+
@@ -91,15 +105,22 @@ import { CreateQueueRequest, CreateQueueResponse, FundInfo, + GetQueueMembersRequest, + GetQueueMembersResponse, GetQueuesResponse, Queue, + RewardFund, SuccessResponse, } from '@/api/types'; -import { ref } from 'vue'; +import { + ref, + watch, +} from 'vue'; import store from '@/store'; import { useRouter } from 'vue-router'; import FundTierInput from '@/components/FundTierInput.vue'; import { sanitize } from '@/lib/helpers'; +import Draggable from 'vuedraggable'; const router = useRouter(); @@ -119,6 +140,8 @@ const minContribution = ref(undefined as number | undefined); const queueSelection = ref(undefined as number | undefined); const queueName = ref(undefined as string | undefined); +const queueMembers = ref(undefined as RewardFund[] | undefined); +const drag = ref(false); const queues = ref([] as Queue[]); const fetchQueues = async () => { @@ -177,6 +200,13 @@ const submit = async () => { } } }; + +watch(queueSelection, async (newValue) => { + if (newValue !== undefined && newValue >= 0) { + const resp = await controller.post('GetQueueMembers', { id: newValue }); + queueMembers.value = resp?.members; + } +});