mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
fix view always return error
This commit is contained in:
parent
b635bdf970
commit
384329bc91
2 changed files with 19 additions and 2 deletions
10
client.go
10
client.go
|
|
@ -394,7 +394,15 @@ func (c *Client) ExportCSV(ctx context.Context, index, frame, view string, slice
|
|||
return ErrIndexRequired
|
||||
} else if frame == "" {
|
||||
return ErrFrameRequired
|
||||
} else if view != ViewInverse || view != ViewStandard {
|
||||
}
|
||||
foundView := false
|
||||
for _, v := range []string{ViewInverse, ViewStandard} {
|
||||
if view == v {
|
||||
foundView = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if foundView == false {
|
||||
return ErrInvalidView
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,13 +49,22 @@ func NewExportCommand(stdin io.Reader, stdout, stderr io.Writer) *ExportCommand
|
|||
// Run executes the export.
|
||||
func (cmd *ExportCommand) Run(ctx context.Context) error {
|
||||
logger := log.New(cmd.Stderr, "", log.LstdFlags)
|
||||
foundView := false
|
||||
|
||||
// Validate arguments.
|
||||
if cmd.Index == "" {
|
||||
return pilosa.ErrIndexRequired
|
||||
} else if cmd.Frame == "" {
|
||||
return pilosa.ErrFrameRequired
|
||||
} else if cmd.View != pilosa.ViewStandard || cmd.View != pilosa.ViewInverse {
|
||||
}
|
||||
|
||||
for _, v := range []string{pilosa.ViewInverse, pilosa.ViewStandard} {
|
||||
if cmd.View == v {
|
||||
foundView = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if foundView == false {
|
||||
return pilosa.ErrInvalidView
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue