Add delete measure

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-04-27 21:01:08 -07:00
parent 76b6df79fc
commit 230ae1130f
10 changed files with 570 additions and 25 deletions

View File

@@ -593,6 +593,20 @@ func (r *mutationResolver) ImportMesure(ctx context.Context, input types.ImportM
}, nil
}
// DeleteMesure is the resolver for the deleteMesure field.
func (r *mutationResolver) DeleteMesure(ctx context.Context, input types.DeleteMesureInput) (*types.DeleteMesurePayload, error) {
svc := GetTenantService(ctx, r.proboSvc, input.MesureID.TenantID())
err := svc.Mesures.Delete(ctx, input.MesureID)
if err != nil {
panic(fmt.Errorf("cannot delete mesure: %w", err))
}
return &types.DeleteMesurePayload{
DeletedMesureID: input.MesureID,
}, nil
}
// CreateControlMesureMapping is the resolver for the createControlMesureMapping field.
func (r *mutationResolver) CreateControlMesureMapping(ctx context.Context, input types.CreateControlMesureMappingInput) (*types.CreateControlMesureMappingPayload, error) {
svc := GetTenantService(ctx, r.proboSvc, input.MesureID.TenantID())