strapi-plugin-prev-next-button
Version:
Prev/Next buttons in Edit view
22 lines (18 loc) • 433 B
text/typescript
import axios from "axios";
import pluginId from "../pluginId";
export type PrevNext = {
prev: {
id: number;
label: string;
} | null;
next: {
id: number;
label: string;
} | null;
};
const getPrevNext = async (uid: string, id: string): Promise<PrevNext> => {
const endpoint = `/${pluginId}/prev-next/${uid}/${id}`;
const { data } = await axios.get(endpoint);
return data;
}
export default getPrevNext;