Adding empty API routes
This commit is contained in:
parent
7513d723ef
commit
74728baf12
|
@ -7,7 +7,8 @@ export const put = async (
|
||||||
id: string,
|
id: string,
|
||||||
content: any,
|
content: any,
|
||||||
isNew: boolean = false,
|
isNew: boolean = false,
|
||||||
db = 'dyomedea_users'
|
db = 'dyomedea_users',
|
||||||
|
overwrite_ = false
|
||||||
) => {
|
) => {
|
||||||
const credentials = adminCredentials();
|
const credentials = adminCredentials();
|
||||||
if (!credentials) {
|
if (!credentials) {
|
||||||
|
@ -19,6 +20,9 @@ export const put = async (
|
||||||
const previous = await get(id, db);
|
const previous = await get(id, db);
|
||||||
if (!!previous) {
|
if (!!previous) {
|
||||||
content._rev = previous._rev;
|
content._rev = previous._rev;
|
||||||
|
if (!overwrite_) {
|
||||||
|
content.__ = previous.__;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
import { APIEvent, json } from 'solid-start/api';
|
||||||
|
|
||||||
|
export async function GET({ params, env }: APIEvent) {
|
||||||
|
console.log({ caller: 'api/conf GET', params });
|
||||||
|
return json({ params, env, response: 'OK' });
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
import { APIEvent, json } from 'solid-start/api';
|
||||||
|
|
||||||
|
export async function GET({ params, env }: APIEvent) {
|
||||||
|
console.log({ caller: 'api/conf GET', params });
|
||||||
|
return json({ params, env, response: 'OK' });
|
||||||
|
}
|
Loading…
Reference in New Issue