update example for ai,
This commit is contained in:
@@ -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 });
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user