Skip to content

Commit

Permalink
Refactor: Move release-related functions to a new release.js file
Browse files Browse the repository at this point in the history
Removed release functions from product.js to improve code organization. Created a new release.js file that contains the getReleases function.
  • Loading branch information
jandsonrj committed Oct 10, 2024
1 parent c2bba38 commit fe492f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion frontend/components/ReleaseSelect.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react'
import PropTypes from 'prop-types'
import MenuItem from '@mui/material/MenuItem'
import { getReleases } from '../services/product'
import { getReleases } from '../services/release'
import { TextField } from '@mui/material'

// export default function ReleaseSelect({ value, onChange, disabled }) {
Expand Down
4 changes: 0 additions & 4 deletions frontend/services/product.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import forIn from 'lodash/forIn'
import { api } from './api'
// import isEmpty from 'lodash/isEmpty'

export const getReleases = ({ }) => {
return api.get('/api/releases/').then(res => res.data)
}

export const getProductTypes = ({ }) => {
return api.get('/api/product-types/').then(res => res.data)
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/services/release.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable camelcase */
import { api } from './api'


export const getReleases = ({ }) => {
export const getReleases = () => {
return api.get('/api/releases/').then(res => res.data)
}

0 comments on commit fe492f6

Please sign in to comment.