// Authz-free again: by the time this runs, the framework has already asked // `resolveResourceRoles` whether the caller holds `teams:rename` on THIS // `teamId`. Re-checking membership here would duplicate the rule. import { EffectStore } from '@voltro/runtime' import type { AppContext } from '@voltro/runtime' import { Effect } from 'effect' const execute = (input: { teamId: string; name: string }, _ctx: AppContext) => Effect.gen(function* () { const store = yield* EffectStore const row = yield* store.update('teams', input.teamId, { name: input.name }) return { id: input.teamId, name: (row?.['name'] as string | undefined) ?? input.name, } }) export default execute