feat: add CSV export for approved orders && add non-delivery reason modal for livreurs
This commit is contained in:
@@ -265,6 +265,12 @@ func (d *Database) CreateCommandWithAddress(username, deliveryAddress string) (*
|
||||
return command, nil
|
||||
}
|
||||
|
||||
func (d *Database) GetApprovedCommands() ([]models.Command, error) {
|
||||
var commands []models.Command
|
||||
err := d.GDB.Where("status = ?", "approved").Order("created_at DESC").Find(&commands).Error
|
||||
return commands, err
|
||||
}
|
||||
|
||||
func (d *Database) GetAllCommands(status, username string) ([]map[string]any, error) {
|
||||
if username != "" {
|
||||
if err := validateUsername(username); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user