fix(pages): fix fetch typing on authors page

This commit is contained in:
parent cb2d4328a8
commit 6e1c940d51
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C
2 changed files with 3 additions and 12 deletions

@ -4,7 +4,6 @@ stages:
- deploy
# define the build stage
build_stage:
stage: build
# use node docker image as enviroment

@ -3,9 +3,7 @@
import { bp, subscriptions } from "@client/listActions";
import { IUser } from "@models/user";
const { data: authors } = (await useApiFetch<any[]>("/authors")) as {
data: Ref<any[]>;
};
const { data: authors } = await useApiFetch<any[]>("/authors");
const { data: rd }: { data: any } = useAuth();
const data = rd as { user: IUser };
@ -31,16 +29,10 @@
<span>({{ item.numStories }})</span>
</a-col>
<a-col v-if="data?.user && data?.user._id" style="margin-left: auto">
<a
v-if="!data?.user.subscriptions.authors.includes(item._id)"
@click="(e) => hider(authors, item._id, 'subscribe', 'authors')"
>
<a v-if="!data?.user.subscriptions.authors.includes(item._id)" @click="(e) => hider(authors, item._id, 'subscribe', 'authors')">
<icon :istyle="'regular'" name="paper-plane" :size="12" />
</a>
<a
v-else
@click="(e) => hider(authors, item._id, 'unsubscribe', 'authors')"
>
<a v-else @click="(e) => hider(authors, item._id, 'unsubscribe', 'authors')">
<icon :istyle="'regular'" name="x" :size="12" />
</a>
</a-col>