update example for ai,

This commit is contained in:
2025-05-17 11:20:33 +08:00
parent 688e102f2c
commit b8309596be

View File

@@ -0,0 +1,17 @@
//
// PURPOSE:
// Update a user's state (active/blocked/pending) in pocketbase
// REQ0006
//
// RULES:
// error handled by caller
// contain definition to collection only
//
import { pb } from '@/lib/pb';
import type { User } from './type';
export default function changeUserState(id: string, state: 'active' | 'blocked' | 'pending'): Promise<User> {
return pb.collection('users').update(id, { state });
}