File size: 690 Bytes
1c0590e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
export async function load({ url, fetch }) {
  let model_parameter = url.searchParams.get("model")

  let model = null;

  if (model_parameter) {
    model_parameter = model_parameter?.replace("/", "@")
  
    const model_request = await fetch(`/api/models/${model_parameter}`, {
      method: "GET",
      headers: {
        "Content-Type": "application/json"
      }
    })
  
    model = await model_request.json()
  }


  const models_request = await fetch("/api/models?page=0&filter=likes&limit=5", {
    method: "GET",
    headers: {
      "Content-Type": "application/json"
    }
  })
  const models = await models_request.json()

  return {
    model: model?.model,
    models
  }
}