fix(pages): fix fetch typing on authors page
This commit is contained in:
parent
cb2d4328a8
commit
6e1c940d51
@ -4,7 +4,6 @@ stages:
|
|||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
# define the build stage
|
# define the build stage
|
||||||
|
|
||||||
build_stage:
|
build_stage:
|
||||||
stage: build
|
stage: build
|
||||||
# use node docker image as enviroment
|
# use node docker image as enviroment
|
||||||
|
@ -3,9 +3,7 @@
|
|||||||
import { bp, subscriptions } from "@client/listActions";
|
import { bp, subscriptions } from "@client/listActions";
|
||||||
import { IUser } from "@models/user";
|
import { IUser } from "@models/user";
|
||||||
|
|
||||||
const { data: authors } = (await useApiFetch<any[]>("/authors")) as {
|
const { data: authors } = await useApiFetch<any[]>("/authors");
|
||||||
data: Ref<any[]>;
|
|
||||||
};
|
|
||||||
|
|
||||||
const { data: rd }: { data: any } = useAuth();
|
const { data: rd }: { data: any } = useAuth();
|
||||||
const data = rd as { user: IUser };
|
const data = rd as { user: IUser };
|
||||||
@ -31,16 +29,10 @@
|
|||||||
<span>({{ item.numStories }})</span>
|
<span>({{ item.numStories }})</span>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col v-if="data?.user && data?.user._id" style="margin-left: auto">
|
<a-col v-if="data?.user && data?.user._id" style="margin-left: auto">
|
||||||
<a
|
<a v-if="!data?.user.subscriptions.authors.includes(item._id)" @click="(e) => hider(authors, item._id, 'subscribe', 'authors')">
|
||||||
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" />
|
<icon :istyle="'regular'" name="paper-plane" :size="12" />
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a v-else @click="(e) => hider(authors, item._id, 'unsubscribe', 'authors')">
|
||||||
v-else
|
|
||||||
@click="(e) => hider(authors, item._id, 'unsubscribe', 'authors')"
|
|
||||||
>
|
|
||||||
<icon :istyle="'regular'" name="x" :size="12" />
|
<icon :istyle="'regular'" name="x" :size="12" />
|
||||||
</a>
|
</a>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user