Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/queryList.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var SavedQueryList = &cobra.Command{
// Delete a saved query from the list.
func deleteSavedQuery(client *HTTPClient, savedQueryID, title string) {
fmt.Printf("\nAttempting to delete '%s'", title)
deleteURL := `filters/filter/` + savedQueryID
deleteURL := `filters/` + savedQueryID
req, err := client.NewRequest("DELETE", deleteURL, nil)
if err != nil {
fmt.Println("Failed to delete the saved query with error: ", err)
Expand Down
12 changes: 7 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func main() {

cli.CompletionOptions.HiddenDefaultCmd = true

// create a default profile if file does not exist
// create a default profile if file does not exist
if previousConfig, err := config.ReadConfigFromFile(); os.IsNotExist(err) {
conf := config.Config{
Profiles: map[string]config.Profile{"demo": defaultInitialProfile()},
Expand All @@ -145,11 +145,13 @@ func main() {
// updates the demo profile for existing users
_, exists := previousConfig.Profiles["demo"]
if exists {
conf := config.Config{
Profiles: map[string]config.Profile{"demo": defaultInitialProfile()},
DefaultProfile: "demo",
conf := config.Profile{
URL: "http://demo.parseable.com",
Username: "admin",
Password: "admin",
}
config.WriteConfigToFile(&conf)
previousConfig.Profiles["demo"] = conf
config.WriteConfigToFile(previousConfig)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/model/savedQueries.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func SavedQueriesMenu() *tea.Program {

// fetchFilters fetches saved SQL queries for the active user from the server
func fetchFilters(client *http.Client, profile *config.Profile) []list.Item {
endpoint := fmt.Sprintf("%s/%s/%s", profile.URL, "api/v1/filters", profile.Username)
endpoint := fmt.Sprintf("%s/%s", profile.URL, "api/v1/filters")
req, err := http.NewRequest("GET", endpoint, nil)
if err != nil {
fmt.Println("Error creating request:", err)
Expand Down
Loading