add show sended invitation to query
This commit is contained in:
parent
252072df57
commit
ba7013ac67
|
@ -56,6 +56,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { formatStartEnd, useMainStore, useUserStore } from '@flaschengeist/api';
|
import { formatStartEnd, useMainStore, useUserStore } from '@flaschengeist/api';
|
||||||
import { computed, defineComponent, ref, onBeforeMount, watch } from 'vue';
|
import { computed, defineComponent, ref, onBeforeMount, watch } from 'vue';
|
||||||
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { QTableProps } from 'quasar';
|
import { QTableProps } from 'quasar';
|
||||||
import { Job } from '../store/models';
|
import { Job } from '../store/models';
|
||||||
import { useEventStore } from '../store';
|
import { useEventStore } from '../store';
|
||||||
|
@ -67,6 +68,8 @@ export default defineComponent({
|
||||||
const store = useEventStore();
|
const store = useEventStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const mainStore = useMainStore();
|
const mainStore = useMainStore();
|
||||||
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
interface RowData extends FG.Invitation {
|
interface RowData extends FG.Invitation {
|
||||||
inviter: FG.User;
|
inviter: FG.User;
|
||||||
|
@ -155,7 +158,12 @@ export default defineComponent({
|
||||||
.finally(() => (loading.value = false));
|
.finally(() => (loading.value = false));
|
||||||
};
|
};
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(async () => {
|
||||||
|
|
||||||
|
if (route.query.sent === 'true') {
|
||||||
|
showSent.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
void Promise.allSettled([
|
void Promise.allSettled([
|
||||||
userStore.getUsers(),
|
userStore.getUsers(),
|
||||||
store.getInvitations(),
|
store.getInvitations(),
|
||||||
|
@ -165,10 +173,13 @@ export default defineComponent({
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(showSent, () => {
|
watch(showSent, async () => {
|
||||||
onRequest({ pagination: pagination.value, filter: () => [], getCellValue: () => [] });
|
onRequest({ pagination: pagination.value, filter: () => [], getCellValue: () => [] });
|
||||||
|
await router.replace({ query: { sent: showSent.value ? 'true' : 'false' } });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getType(row: RowData) {
|
function getType(row: RowData) {
|
||||||
var idx = row.transferee === undefined ? 0 : 1;
|
var idx = row.transferee === undefined ? 0 : 1;
|
||||||
if (row.inviter.userid === mainStore.currentUser.userid) idx += 2;
|
if (row.inviter.userid === mainStore.currentUser.userid) idx += 2;
|
||||||
|
|
Loading…
Reference in New Issue