// SPDX-FileCopyrightText: 2024 Dan Anglin // // SPDX-License-Identifier: GPL-3.0-or-later package client import ( "fmt" "net/http" "codeflow.dananglin.me.uk/apollo/enbas/internal/model" ) const ( pollPath string = "/api/v1/polls" ) func (g *Client) GetPoll(pollID string) (model.Poll, error) { url := g.Authentication.Instance + pollPath + "/" + pollID var poll model.Poll if err := g.sendRequest(http.MethodGet, url, nil, &poll); err != nil { return model.Poll{}, fmt.Errorf( "received an error after sending the request to get the poll: %w", err, ) } return poll, nil }