mirror of
https://github.com/beilunyang/moemail.git
synced 2026-05-30 12:39:54 +08:00
chore: Update checking kv namespace function to avoid failed to create namespace
This commit is contained in:
@@ -96,6 +96,18 @@ export const getKVNamespace = async (namespaceId: string) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const getKVNamespaceList = async () => {
|
||||
try {
|
||||
const kvNamespaces = await client.kv.namespaces.list({
|
||||
account_id: CF_ACCOUNT_ID,
|
||||
});
|
||||
|
||||
return kvNamespaces;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export const createKVNamespace = async () => {
|
||||
try {
|
||||
console.log(`🆕 Creating new KV namespace: "${KV_NAMESPACE_NAME}"`);
|
||||
|
||||
Reference in New Issue
Block a user