INNER CODE UNIT · Go
ids
arp242/goatcounter · api_token.go:236
ids := make([]int32, 0, len(*t))
for _, tt := range *t {
ids = append(ids, int32(tt.ID))
}
return ids
}
// Delete all API tokens in this selection.
func (t *APITokens) Delete(ctx context.Context, _ bool) error {
err := zdb.TX(ctx, func(ctx context.Context) error {
for _, tt := range *t {
err := tt.Delete(WithSite(ctx, &Site{ID: tt.SiteID}))
if err != nil {
return err
}
}
return nil
})