Skip to content

Commit b4437da

Browse files
committed
allow for relative photo and details urls
1 parent e559e35 commit b4437da

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tutorcruncher-socket",
3-
"version": "1.3.2",
3+
"version": "1.3.3",
44
"description": "TutorCruncher socket",
55
"author": "Samuel Colvin <[email protected]>",
66
"private": false,

src/components/contractors/ConModal.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,15 @@ class ConModal extends Component {
5151
)
5252
}
5353
const {contractor, contractor_extra} = _con
54+
let photo_src = contractor.photo
55+
if (photo_src.startsWith('/')) {
56+
photo_src = this.props.config.api_root + photo_src
57+
}
5458
return (
5559
<Modal history={this.props.history} title={contractor.name} last_url={this.props.last_url}>
5660
<div className="tcs-body">
5761
<div className="tcs-extra">
58-
<img src={contractor.photo} alt={contractor.name}/>
62+
<img src={photo_src} alt={contractor.name}/>
5963

6064
<Stars contractor={contractor} root={this.props.root}/>
6165

src/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ export function get_company_options (public_key, config) {
107107

108108
function request (app, path, send_data, method, expected_statuses) {
109109
let url = path
110-
if (!url.startsWith('http')) {
110+
if (url.startsWith('/')) {
111+
url = app.props.config.api_root + url
112+
} else if (!url.startsWith('http')) {
111113
url = `${app.props.config.api_root}/${app.props.public_key}/${path}`
112114
}
113115

0 commit comments

Comments
 (0)