remove strapi
This commit is contained in:
parent
32fd2642b1
commit
7b0880b53b
51 changed files with 35 additions and 7545 deletions
20
src/app.d.ts
vendored
20
src/app.d.ts
vendored
|
|
@ -1,18 +1,14 @@
|
|||
// See https://svelte.dev/docs/kit/types#app.d.ts
|
||||
|
||||
import type { Strapi } from '$lib/server/strapi';
|
||||
|
||||
// for information about these interfaces
|
||||
declare global {
|
||||
namespace App {
|
||||
// interface Error {}
|
||||
interface Locals {
|
||||
strapi: Strapi;
|
||||
}
|
||||
// interface PageData {}
|
||||
// interface PageState {}
|
||||
// interface Platform {}
|
||||
}
|
||||
namespace App {
|
||||
// interface Error {}
|
||||
// interface Locals {}
|
||||
// interface PageData {}
|
||||
// interface PageState {}
|
||||
// interface Platform {}
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
export { };
|
||||
|
|
|
|||
|
|
@ -1,63 +0,0 @@
|
|||
import { strapi, type StrapiClient } from '@strapi/client';
|
||||
|
||||
export class Strapi {
|
||||
public readonly api: string;
|
||||
public readonly uploads: string;
|
||||
|
||||
private readonly client: StrapiClient;
|
||||
|
||||
constructor(url: string, auth: string) {
|
||||
this.api = `${url}/api`;
|
||||
this.uploads = `${url}/uploads`;
|
||||
this.client = strapi({
|
||||
baseURL: this.api,
|
||||
auth: auth
|
||||
});
|
||||
}
|
||||
|
||||
async SiteBackground() {
|
||||
const background = this.client.single('site-background');
|
||||
|
||||
return await background.find({
|
||||
populate: ['Background']
|
||||
});
|
||||
}
|
||||
|
||||
async About() {
|
||||
const about = this.client.single('about');
|
||||
|
||||
return await about.find({
|
||||
populate: ['Titles', 'Photo', 'Activities']
|
||||
});
|
||||
}
|
||||
|
||||
async Blogs() {
|
||||
const blogs = this.client.collection('blogs');
|
||||
|
||||
return await blogs.find({
|
||||
populate: ['Header', 'Topics']
|
||||
});
|
||||
}
|
||||
|
||||
async Blog(id: string) {
|
||||
const blogs = this.client.collection('blogs');
|
||||
|
||||
return await blogs.findOne(id, {
|
||||
populate: ['Header', 'Topics']
|
||||
});
|
||||
}
|
||||
|
||||
async Experiences() {
|
||||
const experiences = this.client.collection('experiences');
|
||||
|
||||
return await experiences.find({
|
||||
populate: ['Logo']
|
||||
});
|
||||
}
|
||||
|
||||
async Education() {
|
||||
const education = this.client.collection('educations');
|
||||
|
||||
return await education.find({});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue