MCPcopy Create free account
hub / github.com/6174/comflowyspace / ApiGetCivitaiModels

Function ApiGetCivitaiModels

apps/node/src/routes/api/models.ts:98–132  ·  view source on GitHub ↗
(req: Request, res: Response)

Source from the content-addressed store, hash-verified

96}
97
98export async function ApiGetCivitaiModels(req: Request, res: Response) {
99 try {
100 const params = req.body
101 console.log("modelId", params);
102 if (params.modelId) {
103 const ret = await getCivitModelById(params.modelId)
104 res.send({
105 success: true,
106 data: ret
107 });
108 return
109 }
110
111 if (params.hash) {
112 const ret = await getCivitModelByHash(params.hash)
113 res.send({
114 success: true,
115 data: ret
116 });
117 return
118 }
119
120 const ret = await listCivitModels(params)
121 res.send({
122 success: true,
123 data: ret
124 });
125 } catch (err) {
126 console.log(err);
127 res.send({
128 success: false,
129 error: err
130 })
131 }
132}

Callers

nothing calls this directly

Calls 4

getCivitModelByIdFunction · 0.90
getCivitModelByHashFunction · 0.90
listCivitModelsFunction · 0.90
logMethod · 0.80

Tested by

no test coverage detected